-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
Check if Client exists when test.client does not exist, to provide clearer exception message #30479
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
fabpot
merged 1 commit into
symfony:3.4
from
SerkanYildiz:fix-logicexception-in-webtestcase
Mar 20, 2019
Merged
Check if Client exists when test.client does not exist, to provide clearer exception message #30479
fabpot
merged 1 commit into
symfony:3.4
from
SerkanYildiz:fix-logicexception-in-webtestcase
Mar 20, 2019
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ping @nicolas-grekas |
fabpot
approved these changes
Mar 20, 2019
…earer exception message
Thank you @SerkanYildiz. |
fabpot
added a commit
that referenced
this pull request
Mar 20, 2019
… provide clearer exception message (SerkanYildiz) This PR was squashed before being merged into the 3.4 branch (closes #30479). Discussion ---------- Check if Client exists when test.client does not exist, to provide clearer exception message | Q | A | ------------- | --- | Branch? | 3.4 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #30420 | License | MIT The `DotEnv` component does not overwrite by using environment variables declared in `.env` files. In the `FrameworkExtension` will be checked if the framework.test config is set to a non-false value, if so it will load the `test.xml` file which contains the definition for the `test.client` service. When running `php bin/phpunit` it will use `phpunit.xml.dist` but because we defined `APP_ENV` in our system it will not load `test.xml` so when creating a client to do functional tests, we'll get an exception which isn't correct: `You cannot create the client used in functional tests if the BrowserKit component is not available. Try running "composer require symfony/browser-kit"` This PR aims to add a clearer exception message which indicates what really should be done to fix the error message. Commits ------- b429950 Check if Client exists when test.client does not exist, to provide clearer exception message
fabpot
added a commit
that referenced
this pull request
Mar 23, 2019
…rkanYildiz) This PR was merged into the 4.3-dev branch. Discussion ---------- [FrameworkBundle] Update Client class to KernelBrowser | Q | A | ------------- | --- | Branch? | master | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | License | MIT I updated recently the WebTestCase with a check to provide a better/more clear exception message (see #30479). After that change @fabpot renamed different `Client` classes in components to a clearer name (for ex Client in HttpKernel is now KernelBrowser etc.). This PR aims to replace the Client in WebTestCase to the new name class name. Commits ------- 28b6dd2 Replace class with new name.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The
DotEnv
component does not overwrite by using environment variables declared in.env
files.In the
FrameworkExtension
will be checked if the framework.test config is set to a non-false value, if so it will load thetest.xml
file which contains the definition for thetest.client
service.When running
php bin/phpunit
it will usephpunit.xml.dist
but because we definedAPP_ENV
in our system it will not loadtest.xml
so when creating a client to do functional tests, we'll get an exception which isn't correct:You cannot create the client used in functional tests if the BrowserKit component is not available. Try running "composer require symfony/browser-kit"
This PR aims to add a clearer exception message which indicates what really should be done to fix the error message.