The tests folder contains your Pest or PHPUnit tests. By default, Laravel Zero ships with an Integration suite written with Pest syntax that can be used as follows:

test('inspiring command', function () {
         ->expectsOutput('Simplicity is the ultimate sophistication.')

As usual, you can always run your tests using the pest command:


Asserting that a command was called

Using the assertCommandCalled test helper method you can check if a specific method was called. This is helpful if you need to check if calling SomeFirstCommand also triggers AnotherCommand.

The inverse of this assertion is assertCommandNotCalled.

Note that both assertions are "argument-sensitive".

test('migration command', function () {
    $this->artisan('migrate', ['--seed' => true]);

    // Assert that a command was called
    $this->assertCommandCalled('migrate', ['--seed' => true]);

    // Assert that a command was *NOT* called
    $this->assertCommandNotCalled('migrate', ['--seed' => false]);

Using PHPUnit-style tests

Pest has full support for running PHPUnit tests, however if you would rather use PHPUnit directly, you can either run the binary with:


Or uninstall Pest and install PHPUnit via Composer:

composer remove pestphp/pest --dev && composer require phpunit/phpunit --dev