Check if Client exists when test.client does not exist, to provide clearer exception message
This commit is contained in:
parent
e9c8e19f46
commit
b429950af6
|
@ -36,7 +36,10 @@ abstract class WebTestCase extends KernelTestCase
|
|||
try {
|
||||
$client = $kernel->getContainer()->get('test.client');
|
||||
} catch (ServiceNotFoundException $e) {
|
||||
throw new \LogicException('You cannot create the client used in functional tests if the BrowserKit component is not available. Try running "composer require symfony/browser-kit".');
|
||||
if (class_exists(Client::class)) {
|
||||
throw new \LogicException('You cannot create the client used in functional tests if the "framework.test" config is not set to true.');
|
||||
}
|
||||
throw new \LogicException('You cannot create the client used in functional tests if the BrowserKit component is not available. Try running "composer require symfony/browser-kit"');
|
||||
}
|
||||
|
||||
$client->setServerParameters($server);
|
||||
|
|
Reference in New Issue