bug #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 https://github.com/symfony/symfony/pull/17272.
Commits
-------
a7b7766
[FrameworkBundle] Add case in Kernel directory guess for PHPUnit
This commit is contained in:
commit
19da1850f6
@ -79,10 +79,14 @@ abstract class KernelTestCase extends \PHPUnit_Framework_TestCase
|
||||
if (preg_match('/^-[^ \-]*c$/', $testArg) || $testArg === '--configuration') {
|
||||
$dir = realpath($reversedArgs[$argIndex - 1]);
|
||||
break;
|
||||
} elseif (strpos($testArg, '--configuration=') === 0) {
|
||||
} elseif (0 === strpos($testArg, '--configuration=')) {
|
||||
$argPath = substr($testArg, strlen('--configuration='));
|
||||
$dir = realpath($argPath);
|
||||
break;
|
||||
} elseif (0 === strpos($testArg, '-c')) {
|
||||
$argPath = substr($testArg, strlen('-c'));
|
||||
$dir = realpath($argPath);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user