Skip to content

Commit

Permalink
Fix filter matching on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
Naktibalda committed Jan 31, 2021
1 parent 2a19935 commit 4d62088
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/Codeception/Command/Run.php
Expand Up @@ -540,7 +540,14 @@ protected function matchTestFromFilename($filename, $testsPath)
{
$filter = '';
if (strpos($filename, ':') !== false) {
list($filename, $filter) = explode(':', $filename, 2);
if ((PHP_OS === 'Windows' || PHP_OS === 'WINNT') && $filename[1] === ':') {
// match C:\...
list($drive, $path, $filter) = explode(':', $filename, 3);
$filename = $drive . ':' . $path;
} else {
list($filename, $filter) = explode(':', $filename, 2);
}

if ($filter) {
$filter = ':' . $filter;
}
Expand Down

0 comments on commit 4d62088

Please sign in to comment.