> laravel-testing
Automated testing standards with Pest and PHPUnit. Use when writing Pest or PHPUnit feature/unit tests in Laravel applications. (triggers: tests/**/*.php, phpunit.xml, feature, unit, mock, factory, sqlite)
curl "https://skillshub.wtf/HoangNguyen0403/agent-skills-standard/laravel-testing?format=md"Laravel Testing
Priority: P1 (HIGH)
Structure
tests/
├── Feature/ # Integration/HTTP tests
├── Unit/ # Isolated logic tests
└── TestCase.php
Implementation Guidelines
- Framework: Use Pest for modern DX or PHPUnit for legacy parity.
- Fresh Context: Use
RefreshDatabasetrait for data isolation. - Factories: Create test data via Eloquent Factories.
- Mockery: Use
$this->mock()for external service substitution. - In-Memory: Use SQLite
:memory:for high-speed unit tests. - HTTP Assertions: Use
$response->assertStatus()andassertJson().
Anti-Patterns
- Real APIs: No real network calls: Always mock or stub.
- Global State: No state leakage: Refresh DB between tests.
- Manual Insert: No DB::table()->insert(): Use Factories.
- Slow Logic: No heavy unit tests: Move to Feature tests.
References
> related_skills --same-repo
> typescript-tooling
Development tools, linting, and build config for TypeScript. Use when configuring ESLint, Prettier, Jest, Vitest, tsconfig, or any TS build tooling. (triggers: tsconfig.json, .eslintrc.*, jest.config.*, package.json, eslint, prettier, jest, vitest, build, compile, lint)
> typescript-security
Secure coding practices for TypeScript. Use when validating input, handling auth tokens, sanitizing data, or managing secrets and sensitive configuration. (triggers: **/*.ts, **/*.tsx, validate, sanitize, xss, injection, auth, password, secret, token)
> typescript-language
Modern TypeScript standards for type safety and maintainability. Use when working with types, interfaces, generics, enums, unions, or tsconfig settings. (triggers: **/*.ts, **/*.tsx, tsconfig.json, type, interface, generic, enum, union, intersection, readonly, const, namespace)
> typescript-best-practices
Idiomatic TypeScript patterns for clean, maintainable code. Use when writing or refactoring TypeScript classes, functions, modules, or async logic. (triggers: **/*.ts, **/*.tsx, class, function, module, import, export, async, promise)