PestPHP Released as Open-Source

PestPHP Released as Open-Source

Console legend Nuno Maduro has open-sourced Pest, an elegant PHP testing framework that focuses on simplicity.

Here’s a quick example of what you can expect, which will be familiar to use if you’ve used other testing tools like Mocha or Jest:

test('asserts true is true', function () {

// or
it('asserts true is true', function () {

Under the hood, Pest tests are bound to a test-case class (PHPUnit’s TestCase by default), which means your closures run in the context of the configured test case:

it('has home', function () {

    // \PHPUnit\Framework\TestCase
    echo get_class($this); 

Be sure to check out the documentation on how can customize the underlying test case via the uses() function that Pest provides.

Be sure to read the Laravel Guide to learn how to create tests with Pest in a Laravel application. Here’s a sneak peek at using a higher-order test with Laravel:

use Tests\Feature;
use Illuminate\Foundation\Testing\DatabaseMigrations;

uses(TestCase::class, DatabaseMigrations::class);

it('has home page')
    ->see('The Laravel Community Portal');

Learn More

Check out PestPHP documentation to start using Pest, and view the source code on GitHub at pestphp/pest. . Pest also has guides for Symfony and PHPUnit. Finally, consider sponsoring Nuno for his excellent work on Pest, Laravel Zero, collision, and Larastan!

Filed in: News


Join 31,000+ others and never miss out on new tips, tutorials, and more.

Laravel News Partners

Laravel Jobs

Laravel Senior Developer
Remote, Canada Only
BeMo Academic Consulting
Senior Fullstack Developer / Architect (w/m/d)
Remote / Munich - Germany GmbH
Medior full stack developer (Laravel)
Deventer (or remote) in the Netherlands, Dutch speaking required.
Senior Full Stack PHP Developer (Laravel)
Senior Laravel Developer