What problem does it solve?
PHP projects often struggle with inconsistent tests, unclear conventions, and maintenance overhead. This Skill standardizes PHPUnit testing conventions to help teams write reliable, readable, and maintainable tests across projects.
Core Features & Use Cases
- Structured guidelines for test naming, class organization, and file layout.
- AAA pattern and Given-When-Then patterns to improve readability and test reliability.
- Data providers, mocks, and stubs guidance to build robust, reusable tests across services.
- Test organization and documentation practices to improve traceability and coverage awareness.
Quick Start
- Install PHP and Composer in your environment.
- Add PHPUnit to your project with Composer: composer require --dev phpunit/phpunit ^9
- Create a sample test following the conventions described in this Skill (class named SomethingTest, extending TestCase, with clear setup and tests)
- Run tests using vendor/bin/phpunit (or phpunit if installed globally) and adjust as needed.