| title | Installation |
|---|---|
| description | Installation |
❗ IMPORTANT: To install Pest v1 in a Laravel 10 project, you must downgrade PHPUnit and Collision to compatible versions.
Run the following command:composer require phpunit/phpunit:^9.6 nunomaduro/collision:^6.1 --dev --with-all-dependencies
The installation process consists of 3 steps:
- Step 1: Require Pest as a dev dependency in your project. Run:
composer require pestphp/pest --dev --with-all-dependencies- Step 2: Continue the installation according to your project specification:
Laravel Framework:
First, you must require the Laravel Plugin. Run the following command:
composer require pestphp/pest-plugin-laravel --devNow, install Pest using Artisan. Run the command below:
php artisan pest:installOther PHP Projects:
Initialize Pest, run the following command:
./vendor/bin/pest --init- Step 3: To run your tests, execute the command:
./vendor/bin/pestThe image below shows the default Test output in a brand-new project:
Next: In the next section, we are going to learn how to write tests with Pest: Writing Tests →
