Skip to content

Commit

Permalink
[FrameworkBundle] fixed the discovery of the PHPUnit configuration fi…
Browse files Browse the repository at this point in the history
…le when using aggregate options like in -vc app/ (closes #7562)
  • Loading branch information
fabpot committed Apr 5, 2013
1 parent d65788b commit 375ded4
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/Symfony/Bundle/FrameworkBundle/Test/WebTestCase.php
Expand Up @@ -82,19 +82,19 @@ protected static function getPhpUnitXmlDir()
}

/**
* Finds the value of configuration flag from cli
* Finds the value of the CLI configuration option.
*
* PHPUnit will use the last configuration argument on the command line, so this only returns
* the last configuration argument
* the last configuration argument.
*
* @return string The value of the phpunit cli configuration option
* @return string The value of the PHPUnit cli configuration option
*/
private static function getPhpUnitCliConfigArgument()
{
$dir = null;
$reversedArgs = array_reverse($_SERVER['argv']);
foreach ($reversedArgs as $argIndex => $testArg) {
if ($testArg === '-c' || $testArg === '--configuration') {
if (preg_match('/^-[^ \-]*c$/', $testArg) || $testArg === '--configuration') {
$dir = realpath($reversedArgs[$argIndex - 1]);
break;
} elseif (strpos($testArg, '--configuration=') === 0) {
Expand Down

0 comments on commit 375ded4

Please sign in to comment.