laravel-testing

Automate Laravel feature, unit, and browser tests with PHPUnit and Dusk.

5|1|Updated Jan 22, 2026
One-click install
npx skills add https://github.com/anilcancakir/my-claude-code --skill laravel-testing-anilcancakir
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: laravel-testing
Source: https://github.com/anilcancakir/my-claude-code/tree/main/skills/laravel-testing
Command: npx skills add https://github.com/anilcancakir/my-claude-code --skill laravel-testing-anilcancakir

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Laravel testing workflows are notoriously manual and error-prone. This Skill streamlines and unifies feature tests, unit tests, and browser tests for Laravel applications, reducing debugging time and improving reliability.

Core Features & Use Cases

  • Unit testing with PHPUnit for models, services, and utilities.
  • Feature testing using HTTP requests, authentication, and database interactions.
  • Browser testing with Laravel Dusk to simulate real user flows.
  • Factories & seeders for generating realistic test data and repeatable scenarios.
  • Test helpers like actingAs, RefreshDatabase, and assertion helpers to speed up development and ensure isolation.

Quick Start

Run the Laravel test suite to validate feature tests, unit tests, and browser tests.

Frequently Asked Questions about laravel-testing

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I automate Laravel testing workflows for feature, unit, and browser tests?

Automate Laravel testing by running suites across feature, unit, and browser tests using PHPUnit and Dusk. This applies factories, refresh database, and browser interactions to reduce debugging time and improve reliability.

What is the best way to run Laravel Dusk browser tests alongside PHPUnit feature tests?

The best way to run Laravel browser tests is unifying them with PHPUnit feature tests using a workflow that supports Dusk. This enables realistic user flow simulations alongside HTTP request and database interaction assertions.

Does this Laravel testing workflow support model factories and database migrations?

Yes, this Laravel testing workflow supports model factories and database migrations. It uses RefreshDatabase and seeders to generate realistic test data and ensure isolated, repeatable testing scenarios.

Do I need Laravel 12+ and PHP to use automated testing helpers like actingAs?

Yes, you need Laravel 12+ and PHP to use these automated testing helpers. The workflow requires this environment to support actingAs, model factories, and database migrations for comprehensive test coverage.

Why are my Laravel feature tests failing with database isolation issues?

Laravel feature tests often fail due to missing database isolation. Applying the RefreshDatabase trait and using model factories resets migrations and generates realistic data, ensuring test scenarios do not conflict.