Skip to content

Commit d650d65

Browse files
committed
fixing WebTastCase when kernel is not found and improving exception message
1 parent 7ee56cc commit d650d65

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

Test/WebTestCase.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,11 +116,12 @@ static protected function getKernelClass()
116116

117117
$finder = new Finder();
118118
$finder->name('*Kernel.php')->depth(0)->in($dir);
119-
if (!count($finder)) {
120-
throw new \RuntimeException('You must override the WebTestCase::createKernel() method.');
119+
$results = iterator_to_array($finder);
120+
if (!count($results)) {
121+
throw new \RuntimeException('Either set KERNEL_DIR in your phpunit.xml according to http://symfony.com/doc/current/book/testing.html#your-first-functional-test or override the WebTestCase::createKernel() method.');
121122
}
122123

123-
$file = current(iterator_to_array($finder));
124+
$file = current($results);
124125
$class = $file->getBasename('.php');
125126

126127
require_once $file;

0 commit comments

Comments
 (0)