Does PHPunit reset local variables?
I have such as Testcase:
PHPUnit ‘Error : Class “pathtoclassclassToTest” not found’
I’m trying to write some unit tests however no matter what I do I keep getting the error ‘Error : Class “pathtoclassclassToTest” not found’.
How to show full diff when assertEquals() fails?
I have a PHPUnit test that’s failing but the test output is hiding important part of the failed data. How to make the whole data visible?
Confusion about mock reuse in phpunit
i’m writing some unit tests and became stuck at what i first thought was a bug, but after much frustration seems to be intended (but impossible to find documentation/mention of) behaviour/usage.
How to mock class functions of class instantiated during test execution
I cannot seem to wrap my head around mocking in phpunit. I have a test like this where I try to mock the execute method of my Curl Wrapper Class “CurlRequest”.
Why use equalTo in phpunit mock checks for the passed arguments?
When I mock a function in phpunit, I can assert that it got called with the right arguments using with
, which accepts constraints like identicalTo
, greaterThan
, and stringContains
. These make sense to me, but why do I need equalTo
?