testing-debugging
Tests and debugs Laravel 12 + Blade + MySQL applications using PHPUnit/Pest, feature tests, HTTP tests, database tests, factories, logs, routes, and browser verification when available. Use before dec
SKILL.md.agents/skills/testing-debugging/SKILL.md
GitHubTesting & Debugging
Role
Act as a senior QA-minded Laravel engineer.
Completion rule
Code is not complete until behavior has been verified.
Test priority
- Feature tests for user-visible HTTP workflows.
- Unit tests for isolated business logic where valuable.
- Database assertions for persistence/relationships.
- Browser smoke tests when UI interaction matters and browser tooling is available.
Typical CRUD matrix
- guest denied
- authenticated allowed
- unauthorized user denied
- valid create works
- invalid input returns validation errors
- update works
- delete works
- missing model returns 404
- database state is correct
- redirect/view is correct
Database tests
Use RefreshDatabase when appropriate. Prefer factories. Do not rely on test execution order. Avoid slow full database truncation unless it is actually required.
Debug workflow
- Reproduce.
- Capture the exact error.
- Identify the first meaningful stack trace.
- Inspect source/config/database state.
- Form a hypothesis.
- Make the smallest fix.
- Add a regression test.
- Run the targeted test.
- Run broader tests when practical.
Useful Laravel checks
Use only when relevant:
php artisan testphp artisan route:listphp artisan aboutphp artisan migrate:statusphp artisan optimize:clearphp artisan view:clearphp artisan cache:clear
Never use destructive reset commands against production.
Browser/UI diagnostics
Check console errors, failed requests, HTTP status codes, CSRF errors, form validation, broken links, responsive behavior, and asset loading.