Note: Pest requires PHP 7.3+ to work.
Check that you have a
phpunit.xmlfile at the root of your project. Otherwise, download this one.
Make sure your existing
composer.jsonfile contains the following options:
"minimum-stability": "dev", "prefer-stable": true,
- Then, make sure your PHPUnit dependency is set to
composer require phpunit/phpunit:"^9.0" --dev --update-with-dependencies
- If you are using Laravel, make sure your Collision dependency is set to
composer require nunomaduro/collision:"^5.0" --dev --update-with-dependencies
- Next, require Pest:
composer require pestphp/pest --dev
- Now, it's time to setup your Pest test suite.
- On Laravel, require the
pest-plugin-laraveland run the
composer require pestphp/pest-plugin-laravel --dev && php artisan pest:install
- On other projects, run the
- Finally, you can run Pest directly from the command line:
On the next section, we are going to learn how to write tests with Pest: Writing Tests →