Laravel theorytheory 0/50 · 0%
Testing · medium

31. Testing with Pest/PHPUnit

Automated tests for Laravel apps.

Laravel ships with PHPUnit support out of the box and integrates smoothly with Pest, a more expressive testing framework built on top of it. Feature tests hit routes via $this->get()/->post() and assert responses, while Unit tests target isolated classes. RefreshDatabase and factories keep the test database clean and populated between tests.

Check your understanding

  1. 1. Which trait resets the database between tests?

  2. 2. What is Pest built on top of?