laravel-controller-tests

Automate Laravel controller tests with HTTP assertions for endpoints and validation.

Updated Jun 8, 2025
One-click install
npx skills add https://github.com/noartem/kawa --skill laravel-controller-tests-noartem
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: laravel-controller-tests
Source: https://github.com/noartem/kawa/tree/main/ui/.ai/skills/laravel-controller-tests
Command: npx skills add https://github.com/noartem/kawa --skill laravel-controller-tests-noartem

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps Laravel developers write focused controller tests using HTTP assertions while ensuring business logic stays in Actions/Services and is unit tested separately.

Core Features & Use Cases

  • Focused controller tests that validate HTTP endpoints, responses, and validation without embedding business logic in controllers.
  • Encourages extracting business logic into Actions/Services and unit testing them directly.
  • Supports using factories to generate realistic data and exercising common endpoint scenarios.

Quick Start

Create a feature test for the POST /register endpoint using HTTP assertions and verify validation behavior.

Frequently Asked Questions about laravel-controller-tests

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

FAQPage Schema
How do I test Laravel controllers with HTTP assertions?

Laravel controller testing with HTTP assertions involves writing feature tests that validate HTTP endpoints, responses, and form validation. This approach verifies endpoint behavior while keeping business logic extracted into Actions/Services for separate unit testing.

What is the best way to test Laravel form validation and error scenarios?

Testing Laravel form validation and error scenarios is best handled by exercising common endpoint scenarios through feature tests. You use factories to generate realistic data and apply HTTP assertions to verify validation behavior across controllers.

Should I unit test business logic separately from Laravel controller feature tests?

Yes, you should unit test business logic separately by extracting it into Actions/Services. Laravel controller tests focus strictly on HTTP assertions and endpoint validation, while the extracted logic receives direct unit tests for thorough coverage.

Can I use factories to generate realistic data for Laravel feature tests?

Yes, you can use factories to generate realistic data for Laravel feature tests. This Skill supports using factories to create test data, allowing you to exercise common endpoint scenarios and validate HTTP responses effectively.

Do I need Laravel testing utilities to write focused HTTP endpoint tests?

Yes, Laravel testing utilities are required to write focused HTTP endpoint tests. This Skill automates controller testing by relying on these built-in utilities to perform HTTP assertions and validate endpoint behavior without embedding business logic.

Why should I avoid embedding business logic in Laravel controller tests?

You should avoid embedding business logic in Laravel controller tests to maintain a clean architecture. Controllers should only handle HTTP requests and responses, while business logic is extracted into Actions/Services and validated with dedicated unit tests.