5 years ago

Issue with Codeception and validations that throw exceptions

Posted 5 years ago by silence

I'm building an app with L4 and Codecept. I have a class similar to L5 FormRequests that throws an exception if the validation fails, then the exception is handle with App::error to basically redirect back with any errors and any input.

Now Codeception doesn't seem to like this because it throws an error.

After some researching I implemented this line:


Now the test doesn't fail but the scenario stops after the exception is thrown. The test passes but the rest of the test (after the exception) is not executed.

I checked Larabook's source with the hope there was something about this, but all the tests are based on scenarios where the user did everything right while I am testing scenarios where the user forgot a field, etc.

I'd appreciate if anyone, maybe even Jeffrey has any idea on how to solve this issue.


Please sign in or create an account to participate in this conversation.