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

Why Definition of Ready Protects a Dev Team and the Role of an Engineering Manager

When a dev team is stuck, blocked, or forced to carry tickets into the next sprint, tickets that aren’t ready are often to blame. One of the biggest hidden productivity drains is work that sounds ready but isn’t. Protecting a team’s time means protecting the work that comes in, not just how the work gets done.