Skip to content

Commit

Permalink
when tests and suite paths are "." we can safely set the suite
Browse files Browse the repository at this point in the history
  • Loading branch information
ctrl-f5 committed Dec 15, 2020
1 parent 81e0c80 commit 1040c00
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/Codeception/Command/Run.php
Expand Up @@ -436,6 +436,9 @@ protected function matchSingleTest($suite, $config)
}
$testsPath = $config['paths']['tests'] . DIRECTORY_SEPARATOR . $suiteConfig['path'];
if ($suiteConfig['path'] === '.') {
if ($config['paths']['tests'] === '.') {
return ['', $s, $suite];
}
$testsPath = $config['paths']['tests'];
}
if (preg_match("~^$testsPath/(.*?)$~", $suite, $matches)) {
Expand All @@ -456,8 +459,11 @@ protected function matchSingleTest($suite, $config)
$realTestDir = realpath(Configuration::testsDir());
$cwd = getcwd();
if (strpos($realTestDir, $cwd) === 0) {
list($path) = explode(':', $suite);
$realPath = $cwd . DIRECTORY_SEPARATOR . $path;
$file = $suite;
if (strpos($file, ':') !== false) {
list($file) = explode(':', $suite, -1);
}
$realPath = $cwd . DIRECTORY_SEPARATOR . $file;
if (file_exists($realPath) || is_dir($realPath)) {
return $this->matchTestFromFilename(
$cwd . DIRECTORY_SEPARATOR . $suite,
Expand Down

0 comments on commit 1040c00

Please sign in to comment.