Installation

Requires PHP 7.3+

  1. First, your composer.json file must have these options: "minimum-stability": "dev", and "prefer-stable": true,.

  2. Then, make sure your PHPUnit dependency is set to ^9.0:

composer require phpunit/phpunit:"^9.0" --dev --update-with-dependencies

Pest will use your current phpunit.xml. If you don't have one, make you sure you download this file and place it on the root of your project.

  1. If you are using Laravel, make sure your Collision dependency is set to ^5.0:
composer require nunomaduro/collision:"^5.0" --dev --update-with-dependencies
  1. Next, require Pest:
composer require pestphp/pest --dev
  1. If you are using Laravel, install Pest in your test suite using the pest:install Artisan command:
php artisan pest:install
  1. Finally, you can run Pest directly from the command line:
./vendor/bin/pest

Install On the next section, we are going to learn how to write tests with Pest: Writing Tests →