Blog

Laravel 11 with Pest: tests that do not slow releases

Author
Ignacio Amat Ignacio Amat
Published
Reading Time 3 min
Terminal showing successful execution of Pest tests in a modern Laravel project

In many teams, testing is seen as a “necessary evil” that slows down development. “We don’t have time for tests, we need to ship now.” As a Full Stack developer, my response is always the same: you don’t have time not to test.

With modern Laravel and Pest, testing has gone from being a burden to being a speed tool. Here’s my strategy for maintaining quality without slowing down deployment.

Why Pest?

Pest is not just “PHPUnit with pretty syntax.” It’s a mindset shift. The functional syntax makes tests much more readable and, therefore, easier to maintain.

A test in Pest reads almost like natural language:

it('allows a premium user to download reports', function () {
    $user = User::factory()->premium()->create();

    $this->actingAs($user)
        ->get('/reports/download')
        ->assertStatus(200);
});

My Testing Pyramid in 2026

Not all tests are worth the same. To maximize the ROI of the time invested, I follow this structure:

1. Feature Tests (60%)

This is where I focus most. They test complete functionality from the user’s or API’s perspective. If the Feature Test passes, I know the business is safe. Laravel makes it incredibly easy with its HTTP and authentication helpers.

2. Unit Tests (30%)

For complex logic, calculations, or isolated services. They are ultra-fast and allow me to test all edge cases of a function without touching the database.

3. Architecture Tests (10%)

One of my favorite features of Pest. They allow you to ensure the team follows architectural rules automatically:

arch('globals')
    ->expect(['dd', 'dump', 'var_dump'])
    ->not->toBeUsed();

arch('app')
    ->expect('App\Models')
    ->toOnlyBeUsedIn('App\Repositories');

AI-Augmented Testing

This is where the 2026 factor comes in. I use Claude Code to generate the “scaffold” for the tests.

My workflow:

  1. Write the feature logic.
  2. Ask Claude: “Read this controller and generate the necessary feature tests covering success, failed validation, and permission cases”.
  3. Review and adjust the generated tests.

This eliminates 80% of the repetitive work of writing tests.

The CI/CD Pipeline: The Ultimate Truth

No code reaches main if the tests don’t pass. I use GitHub Actions to run the Pest suite on every PR. If a test fails, the deployment is blocked. This allows me to sleep peacefully knowing I haven’t broken critical functionality in a Friday afternoon release.

Conclusion

Testing with modern Laravel and Pest is not an obstacle; it’s the life insurance for your product. It allows you to refactor with confidence and constantly deliver value.

Once a team reaches that level of confidence, reviews get easier and deployments become less stressful. That is the real difference between simply having tests and using testing as a product-delivery advantage.

If you want to see how I apply testing and quality judgment in real product work, review my technical stack and selected projects.

Related articles

Review my developer profile

If this article matches the kind of product work your team is facing, review my stack or professional availability.

Send the role context

Role, stack, work model and timing are enough for me to confirm fit. I reply within 24 business hours.

0/500
Availability