php-testing-style

Installation
SKILL.md

PHP Testing Style

Default Heuristics

  • Prefer FIRST: Fast, Isolated, Repeatable, Self-Verifying, and Timely.
  • Prefer OTAO: one test covers one behavior and ideally has one reason to fail. Multiple assertions are fine when they verify that same behavior.
  • Name unit tests given{SomeCondition}_should{ExpectedResult} and mark them with PHPUnit's #[Test] attribute when their names do not use PHPUnit's test... discovery prefix.
  • Name the observed value $actual.
  • Use PHPUnit assertions from PHPUnit\Framework\TestCase; do not introduce Pest or another assertion style unless the project requires it or the user asks for it.
  • Keep assertions simple and readable.
  • Do not add tests for unchanged existing behavior solely because an acceptance criterion mentions it. Test the regression risk introduced by the change at the boundary where the new composition occurs, and rely on existing collaborator contracts unless those contracts or their integration changed.

Unit Tests

Installs
1
First Seen
7 days ago
php-testing-style — pepperize/php-skills