Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
[FrameworkBundle] Add BrowserKitAssertionsTrait::assertThatForBrowser#42526
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
fabpot commentedAug 26, 2021
When you are calling your assertion in a test, you do have access to the current client, so I don't see the benefit of this new method (which makes difficult to understand what's going on IMHO). |
nep-koen commentedAug 26, 2021
Yes I agree that the benefits are small, though someone at some points made the decision to be able to call browser kit assertions without passing any arguments, instead acting on the internal state of the test class (e.g. For the sake of consistency I would like to be able to do the same for my own assertions (e.g. If I hadn't needed the request method and path this would have been completely possible using |
fabpot left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Ok, fair enough, that makes sense to me. Can you rename the method to be consistent with the current naming?
src/Symfony/Bundle/FrameworkBundle/Test/BrowserKitAssertionsTrait.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
fabpot commentedAug 26, 2021
Thank you@koenreiniers. |
Uh oh!
There was an error while loading.Please reload this page.
I wanted to create a constraint that acts on the request and the response (an openapi schema validator constraint that needs the method and pathinfo from the request and the body from the response). But, there is currently no way to get the current client, since
BrowserKitAssertionsTrait::getClientis private and there is no method to do an assertion on the client/browser (likeBrowserKitAssertionsTrait::assertThatForResponsefor the response).This small change will allow to do the following: