Skip to content

Latest commit

 

History

History
82 lines (52 loc) · 1.68 KB

File metadata and controls

82 lines (52 loc) · 1.68 KB
title Installation
description Installation

Installation

Requirements

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

Install

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 --dev

Now, install Pest using Artisan. Run the command below:

php artisan pest:install

Other PHP Projects:

Initialize Pest, run the following command:

./vendor/bin/pest --init

- Step 3: To run your tests, execute the command:

./vendor/bin/pest

The image below shows the default Test output in a brand-new project:

Install


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