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

This commit is contained in:
Fabien Potencier 2010-11-16 11:17:42 +01:00
parent 3127312139
commit 23d7967f81

View File

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