Laravel 8.0 with Pest testing framework

Jayden Chua
5 min readJul 15, 2021

“Pest is a Testing Framework with a focus on simplicity. It was carefully crafted to bring the joy of testing to PHP.” — Pest Website. It plays nicely with PHPUnit, complementing it rather than compete with it.

A quick overview of what this article will cover. I will be documenting the following topics, this is mostly a setup walk-through rather than an in-depth guide about how to use Pest.

  • Installing Pest in Laravel
  • Using Pest
  • Setting up PHPStorm
  • Setting up PHPStorm with Xdebug

Installing Pest

Before you start, this assumes you already have composer and PHP 7.3+ installed on your development environment.

Install Pest via Composer with,

$ composer require pestphp/pest --dev --with-all-dependencies

Next, install a plugin for Laravel.

$ composer require pestphp/pest-plugin-laravel --dev$ php artisan pest:install// if you are on sail
$ sail artisan pest:install

If everything is working, try it out with

$ php artisan test// if you are on sail
$ sail artisan test

--

--

Jayden Chua
Jayden Chua

Written by Jayden Chua

An avid web developer constantly looking for new web technologies to dabble in, more information can be found on bit.ly/jayden-chua

Responses (2)