Agent Skills: Controller Tests

Write focused controller tests using HTTP assertions; keep heavy logic in Actions/Services and unit test them

UncategorizedID: noartem/laravel-vue-skills/laravel-controller-tests

Install this agent skill to your local

pnpm dlx add-skill https://github.com/noartem/skills/tree/HEAD/skills/laravel-controller-tests

Skill Files

Browse the full folder contents for laravel-controller-tests.

Download Skill

Loading file tree…

skills/laravel-controller-tests/SKILL.md

Skill Metadata

Name
laravel-controller-tests
Description
Write focused controller tests using HTTP assertions; keep heavy logic in Actions/Services and unit test them

Controller Tests

Feature tests for endpoints

it('rejects empty email', function () {
  $this->post('/register', ['email' => ''])->assertSessionHasErrors('email');
});

Better tests

  • 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