| title | Installation |
|---|---|
| description | Installation |
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
^9.3.10:
composer require phpunit/phpunit:"^9.3.10" --dev --update-with-dependenciesIf you are using Laravel, make sure your Collision dependency is set to ^5.0:
composer require nunomaduro/collision:"^5.0" --dev --update-with-dependenciesNow you can require Pest:
composer require pestphp/pest --devNow, it's time to setup your Pest test suite.
- On Laravel, require the
pest-plugin-laraveland run thepest:installArtisan command:
composer require pestphp/pest-plugin-laravel --dev && php artisan pest:install- On other projects, run the
pest --initcommand:
./vendor/bin/pest --initFinally, you can run Pest directly from the command line:
./vendor/bin/pestOn the next section, we are going to learn how to write tests with Pest: Writing Tests →
