Yes, we don't have any explicit assertions, but PHPUnit mock system do some assertions for us, e.g. we expect that getMasterRequest() and getFirewallConfig() methods are called and called exactly *once*, etc. So, if one of those methods was not called, or was called more than once - PHPUnit would show the test as failed. So, it's kinda assertions behind the scene.
I'd recommend you to re-watch information about PHPUnit mocks to get more context about it.
Cheers!
Please, log in to vote for this comment
|
Share Comment
"Houston: no signs of life" Start the conversation!
The concepts in this tutorial work great for Symfony 5!
2 Comments
Why this test does not have any assertions? I'm new to testing but still...
Hey Martin,
Yes, we don't have any explicit assertions, but PHPUnit mock system do some assertions for us, e.g. we expect that getMasterRequest() and getFirewallConfig() methods are called and called exactly *once*, etc. So, if one of those methods was not called, or was called more than once - PHPUnit would show the test as failed. So, it's kinda assertions behind the scene.
I'd recommend you to re-watch information about PHPUnit mocks to get more context about it.
Cheers!
"Houston: no signs of life"
Start the conversation!