Catch An Expected Exception In PHP Unit Test

Something I ran into a while back while writing tests.

If intentionally testing code for an exception then it is required to add an annotation above the test method.

For example if the code will throw IllegalArgumentException.

Share this Story
  • PHP Programming Testing

    Catch An Expected Exception In PHP Unit Test

    Something I ran into a while back while writing tests. If intentionally testing code for an exception then it is required to ...
Load More Related Articles
Load More By Nick Escobedo
Load More In PHP

Check Also

Selecting Your Next App Dependency

We often turn to open source or proprietary packages for adding functionality to our apps. Here are some key points and questions to ask when selecting your next dependency.