Skip to content
Back to skills

Controller Tests

ASecurity

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

  • 147 stars
  • 0 votes
  • 0 copies
  • 4 views
  • Added June 6, 2026
testingphp

Security analysis

A100/100

Scanned June 6, 2026

npx -y skills add jpcaparas/superpowers-laravel --skill controller-tests --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Controller Tests?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Controller Tests
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/jpcaparas-controller-tests/badge)](https://www.skillsdirectory.com/skills/jpcaparas-controller-tests)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
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

```php
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

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.