Files
everything-claude-code/.cursor/rules/php-testing.md
2026-03-10 21:10:26 -07:00

740 B

description, globs, alwaysApply
description globs alwaysApply
PHP testing extending common rules
**/*.php
**/phpunit.xml
**/phpunit.xml.dist
**/composer.json
false

PHP Testing

This file extends the common testing rule with PHP specific content.

Framework

Use PHPUnit as the default test framework. Pest is also acceptable when the project already uses it.

Coverage

vendor/bin/phpunit --coverage-text
# or
vendor/bin/pest --coverage

Test Organization

  • Separate fast unit tests from framework/database integration tests.
  • Use factory/builders for fixtures instead of large hand-written arrays.
  • Keep HTTP/controller tests focused on transport and validation; move business rules into service-level tests.