Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit b429950

Browse filesBrowse files
SerkanYildizfabpot
authored andcommitted
Check if Client exists when test.client does not exist, to provide clearer exception message
1 parent e9c8e19 commit b429950
Copy full SHA for b429950

File tree

Expand file treeCollapse file tree

1 file changed

+4
-1
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+4
-1
lines changed

‎src/Symfony/Bundle/FrameworkBundle/Test/WebTestCase.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/Test/WebTestCase.php
+4-1Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,10 @@ protected static function createClient(array $options = [], array $server = [])
3636
try {
3737
$client = $kernel->getContainer()->get('test.client');
3838
} catch (ServiceNotFoundException $e) {
39-
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".');
39+
if (class_exists(Client::class)) {
40+
throw new \LogicException('You cannot create the client used in functional tests if the "framework.test" config is not set to true.');
41+
}
42+
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"');
4043
}
4144

4245
$client->setServerParameters($server);

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.