Skip to content

Commit 19da185

Browse files
committed
bug symfony#17279 [2.7][FrameworkBundle] Add case in Kernel directory guess for PHPUnit (tgalopin)
This PR was merged into the 2.7 branch. Discussion ---------- [2.7][FrameworkBundle] Add case in Kernel directory guess for PHPUnit | Q | A | ------------- | --- | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | - | License | MIT | Doc PR | - The current automatic guess of the Kernel directory in the context of PHPUnit does work properly using the following commands: - `phpunit -c app` - `phpunit --configuration app` - `phpunit --configuration=app` But it fails with the synthax `phpunit -capp`, even if PHPUnit supports it. This PR fixes this. See symfony#17272. Commits ------- a7b7766 [FrameworkBundle] Add case in Kernel directory guess for PHPUnit
2 parents c4cc147 + a7b7766 commit 19da185

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/Symfony/Bundle/FrameworkBundle/Test/KernelTestCase.php

+5-1
Original file line numberDiff line numberDiff line change
@@ -79,10 +79,14 @@ private static function getPhpUnitCliConfigArgument()
7979
if (preg_match('/^-[^ \-]*c$/', $testArg) || $testArg === '--configuration') {
8080
$dir = realpath($reversedArgs[$argIndex - 1]);
8181
break;
82-
} elseif (strpos($testArg, '--configuration=') === 0) {
82+
} elseif (0 === strpos($testArg, '--configuration=')) {
8383
$argPath = substr($testArg, strlen('--configuration='));
8484
$dir = realpath($argPath);
8585
break;
86+
} elseif (0 === strpos($testArg, '-c')) {
87+
$argPath = substr($testArg, strlen('-c'));
88+
$dir = realpath($argPath);
89+
break;
8690
}
8791
}
8892

0 commit comments

Comments
 (0)