Procházet zdrojové kódy

[FrameworkBundle] fixed phpunit when ran from the app directory directly without -c

Fabien Potencier před 14 roky
rodič
revize
23d7967f81

+ 2 - 0
src/Symfony/Bundle/FrameworkBundle/Test/WebTestCase.php

@@ -74,6 +74,8 @@ abstract class WebTestCase extends BaseWebTestCase
             $dir = $dir.'/'.$matches[1];
         } elseif (preg_match('/\-c +([^ ]+)/', $cli, $matches)) {
             $dir = $dir.'/'.$matches[1];
+        } elseif (file_exists(getcwd().'/phpunit.xml') || file_exists(getcwd().'/phpunit.xml.dist')) {
+            $dir = getcwd();
         } else {
             throw new \RuntimeException('Unable to guess the Kernel directory.');
         }