Skip to content

Commit b0a06b7

Browse files
YumeNikki101nicolas-grekas
authored andcommitted
[PhpUnitBridge] Fix finding a config file given by its exact name
The .dist.xml support rewrite dropped the exact-name check, so an explicitly given config file (-c custom.xml) was only probed with the .xml/.xml.dist/.dist.xml suffixes appended and the wrapper silently ignored the SYMFONY_PHPUNIT_* settings it contains (phpunit itself still received it through passthrough). Probe the verbatim name after the suffixed candidates: probing it first would make the default "phpunit" lookup resolve to an extensionless phpunit binary or shim in the working directory, shadowing phpunit.xml(.dist).
1 parent 3e1c9a9 commit b0a06b7

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

bin/simple-phpunit.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,12 @@
4444
}
4545
}
4646

47+
// probe the verbatim name last so that the default "phpunit" lookup keeps
48+
// resolving to phpunit.xml(.dist) when an extensionless "phpunit" file exists
49+
if (file_exists($probableConfig)) {
50+
return $probableConfig;
51+
}
52+
4753
return null;
4854
};
4955

0 commit comments

Comments
 (0)