Installation
Requirements: PHP 8.2+
Installing Pest PHP Testing Framework is a simple process that can be completed in just a few steps. Before you begin, make sure you have PHP 8.2+
or higher installed on your system.
The first step is to require Pest as a "dev" dependency in your project by running the following commands on your command line.
1composer remove phpunit/phpunit2composer require pestphp/pest --dev --with-all-dependencies
Secondly, you'll need to initialize Pest in your current PHP project. This step will create a configuration file named Pest.php
at the root level of your test suite, which will enable you to fine-tune your test suite later.
1./vendor/bin/pest --init
Finally, you can run your tests by executing the pest
command.
1./vendor/bin/pest
Here is an example of the output displayed when running Pest in a new, fresh project.
Optionally, if you are migrating from PHPUnit, you can use the pest-plugin-drift
package to automatically convert your PHPUnit tests to Pest. For more information, check out the Migrating from PHPUnit guide.
After the installation process is finished, you can enhance your developer experience while working with Pest by configuring your editor: Editor Setup →. If you're migrating from PHPUnit, check out the Migration Guide →.