Has nobody else run into this problem with Codeception when running functional tests? Not even Google has an answer, it's making me feel pretty special if you know what I mean!
Aug 21, 2014
4
Level 4
Codeception and Laravel Exceptions
Codeception appears to choke on Laravel exceptions. The moment an exception is thrown the test stops and is marked as failed. This happens even when the test is purposely causing an exception to be thrown and testing to see it's handled correctly.
Anybody else run into this or know a work around?
Level 1
I don't have my work code in front of me at the moment which I've done this before, but try this out, put this line in your test right before you expect to see the exception, just make sure to reference the proper exception class:
\PHPUnit_Framework_TestCase::setExpectedException('Laracasts\Validation\FormValidationException');
edit: for reference, this works with codeception since it leverages phpunit
2 likes
Please or to participate in this conversation.