From 375ded4227f55b341898446434336fb56a3f11ef Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Fri, 5 Apr 2013 08:39:48 +0200 Subject: [PATCH] [FrameworkBundle] fixed the discovery of the PHPUnit configuration file when using aggregate options like in -vc app/ (closes #7562) --- src/Symfony/Bundle/FrameworkBundle/Test/WebTestCase.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Symfony/Bundle/FrameworkBundle/Test/WebTestCase.php b/src/Symfony/Bundle/FrameworkBundle/Test/WebTestCase.php index ea0c49ecbd..0048f5539c 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Test/WebTestCase.php +++ b/src/Symfony/Bundle/FrameworkBundle/Test/WebTestCase.php @@ -82,19 +82,19 @@ abstract class WebTestCase extends \PHPUnit_Framework_TestCase } /** - * 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) {