8000 bug #17278 [2.3][FrameworkBundle] Add case in Kernel directory guess … · symfony/symfony@f9bf3f8 · GitHub
[go: up one dir, main page]

Skip to content

Commit f9bf3f8

Browse files
committed
bug #17278 [2.3][FrameworkBundle] Add case in Kernel directory guess for PHPUnit (tgalopin)
This PR was merged into the 2.3 branch. Discussion ---------- [2.3][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 #17272. Commits ------- 758fc1d [FrameworkBundle] Add case in Kernel directory guess for PHPUnit
2 parents 61daebf + 758fc1d commit f9bf3f8

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,10 +103,14 @@ private static function getPhpUnitCliConfigArgument()
103103
if (preg_match('/^-[^ \-]*c$/', $testArg) || $testArg === '--configuration') {
104104
$dir = realpath($reversedArgs[$argIndex - 1]);
105105
break;
106-
} elseif (strpos($testArg, '--configuration=') === 0) {
106+
} elseif (0 === strpos($testArg, '--configuration=')) {
107107
$argPath = substr($testArg, strlen('--configuration='));
108108
$dir = realpath($argPath);
109109
break;
110+
} elseif (0 === strpos($testArg, '-c')) {
111+
$argPath = substr($testArg, strlen('-c'));
112+
$dir = realpath($argPath);
113+
break;
110114
}
111115
}
112116

0 commit comments

Comments
 (0)
0