Move validation to Form Requests; assert errors from the request class
Extract business logic into Actions; unit test them directly
Use factories for realistic data; avoid heavy mocking
1---2name: laravel-controller-tests3description: Controller Tests4---5# Controller Tests67## Feature tests for endpoints89```php10it('rejects empty email', function () {11 $this->post('/register', ['email' => ''])->assertSessionHasErrors('email');12});13```1415## Better tests1617- Move validation to Form Requests; assert errors from the request class18- Extract business logic into Actions; unit test them directly19- Use factories for realistic data; avoid heavy mocking
Run npx skillmds@latest add comeonoliver/laravel-controller-tests in your terminal (requires Node.js), paste this page's agent-chat prompt into Claude, Cursor, or any MCP-connected agent, or download the SKILL.md file and copy it into your agent's skills directory.
Controller Tests It is listed under Coding & Dev Tools on SkillMD.
This skill has not completed SkillMD's automated safety review yet. Independent scanners report: SkillSpector: PASS, Skill Scanner: PASS. SkillMD never runs a skill's scripts for you; review the SKILL.md before installing.
This skill is tagged as working with Claude Code, Claude.ai, OpenAI Codex. SKILL.md is an open format, so most agents that read a skills directory can load it too.
Yes. Installing skills from SkillMD is free, and the skill stays under its author's original license.
ComeOnOliver (@comeonoliver) published this skill. Their other Agent Skills are listed on their SkillMD profile.