Просмотр исходного кода

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

Fabien Potencier 14 лет назад
Родитель
Сommit
23d7967f81
1 измененных файлов с 2 добавлено и 0 удалено
  1. 2 0
      src/Symfony/Bundle/FrameworkBundle/Test/WebTestCase.php

+ 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.');
         }