0PricingLogin
PHP Academy · Lesson

PHPUnit Setup and First Test

Install PHPUnit via Composer and write your first test class.

What is PHPUnit?

PHPUnit is PHPs standard unit testing framework. It lets you write automated tests that verify individual units of code in isolation.

Installing PHPUnit

Install via Composer as a dev dependency.

$ composer require --dev phpunit/phpunit "^11.0"

All lessons in this course

  1. PHPUnit Setup and First Test
  2. Assertions and Test Methods
  3. Data Providers for Parameterized Tests
  4. Mocking Dependencies with PHPUnit
← Back to PHP Academy