Interested in generating passive income? Join our partnership program and receive a commission on each new client referral. Learn more.
6 min read
Interested in generating passive income? Join our partnership program and receive a commission on each new client referral. Learn more.
Every refactor, feature release, or infrastructure change carries risk - unless you’ve already tested what matters. At Redberry, we treat testing as an integral part of our development lifecycle, not a final QA step. From day one, we build out test suites that protect core business logic, so teams can scale without fear of breaking things.
As official Laravel Partners, we rely heavily on Pest, a modern testing framework built on top of PHPUnit. Pest’s syntax feels intuitive and expressive, making it easier to write and maintain high-quality tests across an entire codebase. We’re also proud to sponsor Pest because we believe it’s one of the most important open-source projects in the PHP ecosystem. In this blog, we break down the different layers of testing in a Laravel application - from isolated unit tests to full-blown browser tests - and how we integrate them into a modern CI/CD workflow.
Most bugs don’t happen in isolation - they’re the result of subtle logic errors, edge cases, or regressions that sneak in during refactoring. That’s why we start with the foundation: unit and feature tests. This early testing work fits naturally into the broader development lifecycle we follow on every project, which you can see outlined in our guide to the Laravel web app development lifecycle.
At Redberry, we write unit tests to cover our application’s core logic. These tests validate isolated pieces of functionality, such as services, helpers, repositories, or model scopes. For example, a test might assert that a DiscountService calculates the correct total after applying various coupon codes.
Feature tests go one level higher and validate how components interact. We use them to test form requests, controllers, and full request flows - ensuring, for example, that a form submission leads to the correct response and updates the database properly.
Using Laravel factories and Pest’s expressive syntax, we simulate real data scenarios with minimal boilerplate:
it('validates registration form request', function () {
$response = $this->post('/register', [
'email' => 'invalid-email',
'password' => 'short',
]);
$response->assertSessionHasErrors(['email', 'password']);
});
This test reads almost like plain English. With Pest, writing expressive and maintainable tests becomes part of the development rhythm, not an afterthought.
To simulate real-world user behavior, we use end-to-end browser testing. This allows us to catch issues that might slip past unit or feature tests - particularly those involving frontend logic, JavaScript, or complex user flows.
Laravel offers two powerful options here: Dusk and Pest’s browser testing powered by Playwright. Depending on the project, we choose the tool that best fits the frontend stack and testing needs.
For critical paths like login, checkout, or onboarding flows, we write full-stack tests that interact with the app like a real user would:
it('logs in through browser', function () {
$user = User::factory()->create();
$page = visit('/login')
->type('email', $user->email)
->type('password', 'password')
->press('Sign In')
->assertPathIs('/dashboard')
->assertSee('Welcome back');
});
This test launches a browser, clicks buttons, fills out forms, and verifies UI responses. It’s especially useful in identifying regressions caused by frontend changes or integration issues across the stack.
When Laravel serves as a backend for mobile or SPA frontends, API testing becomes a priority. Laravel makes it easy to send HTTP requests and assert JSON responses within tests.
Redberry builds many applications with an API-first approach - so we use HTTP tests to validate authentication, data formats, status codes, and business logic in endpoints. Pest’s fluent API makes this a breeze:
it('returns user profile', function () {
$user = User::factory()->create();
$response = $this->actingAs($user)->getJson('/api/profile');
$response->assertOk()
->assertJsonFragment(['email' => $user->email]);
});
These API tests help us catch issues early in development - before they ever reach frontend teams or mobile apps consuming the endpoints.
Testing doesn’t stop at functional correctness - it extends to code quality and maintainability. At Redberry, our pipelines include tools that enforce clean, reliable code.
As our team puts it, “Pest, Pint, and PHPStan don’t just catch mistakes - they give us peace of mind that the code we’re shipping is solid.”
Automation is key to maintaining speed without sacrificing quality. At Redberry, we hook our test suites into CI/CD pipelines to validate every pull request.
Using GitHub Actions, we run:
This pipeline runs in every environment - from development branches to staging and production. It ensures that nothing gets deployed without a green build.
If a regression sneaks in - a failing assertion or a styling violation - it’s caught before the PR can be merged. This keeps our main branches clean and our release process reliable.
Great test coverage isn’t just about quantity - it’s about strategically testing what matters most.
At Redberry, we focus coverage on:
In addition to coverage, we also peer-review test code during pull requests. A second set of eyes often catches edge cases or improves test clarity. This culture of quality reinforces our commitment to building software that lasts.
And when something does break, a solid test suite becomes the safety net. We can revert, refactor, and evolve the codebase confidently - knowing that automated tests are there to back us up.
At Redberry, automated testing is not just part of our workflow - it’s part of our culture. We believe that high-quality code is the foundation of long-lasting software. That’s why we invest deeply in testing: from Pest to Dusk, from static analysis to CI pipelines.
As official Laravel Partners, Vue Partners, and sponsors of both Filament and Pest, we’re committed to giving back to the ecosystem we rely on - and helping our clients ship better software, faster.
If you’re building a Laravel web application and want to ensure quality at every step, explore our Laravel Web App Development services to see how we can help.

We are a 200+ people agency and provide product design, software development, and creative growth marketing services to companies ranging from fresh startups to established enterprises. Our work has earned us 100+ international awards, partnerships with Laravel, Vue, Meta, and Google, and the title of Georgia’s agency of the year in 2019 and 2021.
