Testing your app
Feature tests, Pest filters, and habits that keep CI green.
Photo by Carlos Muza on Unsplash.
Atlas ships with a testing harness for HTTP, database, and queue assertions. Prefer feature tests for user journeys and unit tests for pure domain logic.
Run the suite
bashExample
php atlas test
php atlas test --filter=ProjectTestExample feature test
phptests/Feature/ProjectTest.php
it('creates a project for the authenticated user', function () {
$user = User::factory()->create();
$this->actingAs($user)
->post('/projects', ['name' => 'Northwind'])
->assertRedirect()
->assertSessionHasNoErrors();
expect(Project::query()->where('name', 'Northwind')->exists())->toBeTrue();
});Tip
Use RefreshDatabase on feature tests. Sharing a dirty schema between examples is the fastest way to create flaky CI.
- Happy-path create/update/delete coverage
- Authorization denial cases
- Validation error payloads
- Queued side effects faked and asserted
Updated Aug 5, 2026
