Timeline for PHPUnit assert that an exception was thrown?
Current License: CC BY-SA 4.0
6 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
S Apr 3, 2021 at 14:15 | history | suggested | Anuj Shrestha | CC BY-SA 4.0 |
Updated the wrong use of arguments as mentiond on the comment of the the solution.
|
Apr 3, 2021 at 13:23 | review | Suggested edits | |||
S Apr 3, 2021 at 14:15 | |||||
Oct 21, 2019 at 16:06 | comment | added | Roger Campanera |
The signature of assertEquals() is assertEquals(mixed $expected, mixed $actual...) , reverse as in your example, so it should be $this->assertEquals("Exception message", $ex->getMessage());
|
|
May 3, 2017 at 6:56 | history | edited | Basil Musa | CC BY-SA 3.0 |
No need for return statement, allows you to continue with your unit test after the catch.
|
Jan 26, 2016 at 14:54 | review | Late answers | |||
Jan 26, 2016 at 14:56 | |||||
Jan 26, 2016 at 14:34 | history | answered | ab_wanyama | CC BY-SA 3.0 |