controller-testing
Installation
SKILL.md
Controller Testing
When to Apply
Activate this skill only when the task is about Laravel controller feature tests (action-level HTTP behavior for a controller) and includes signals like:
- The test file path is under
tests/Feature/Http/Controllers/**(includingtests/Feature/Http/Controllers/Api/**). This is the primary trigger. - The task is explicitly about a controller action and uses action-level
describe('create' | 'destroy' | 'edit' | 'index' | 'show' | 'store' | 'update'). - Controller route assertions using
route(...), nested parameters, and route-model binding scope checks. - Auth/authorization outcomes and controller transport assertions:
- web/session (
get,post,patch,delete,assertInertia, redirects), or - API/JSON (
getJson,postJson,patchJson,deleteJson, JSON assertions).
- web/session (
Do not activate this skill based on describe('store') alone (many non-controller feature tests use the same verbs, for example Fortify/auth flows).
Do not use this skill for model/unit tests, service-layer tests, console commands, or non-HTTP behavior.