- Always write tests for your application.
- When project starts, please choose a testing toolset and continue using it during project for the consistency.
- Before starting implementing new functional code, make sure all your core logic is covered with unit tests (PHPUnit / PHPSpec).
- We use unit tests only for code related to bussiness logic, so please do not write them for controllers, repositories, fixture generators, getters, setters etc.
- For integration tests we use PHPUnit with lchrusciel/api-test-case library. The integration tests means testing code with integration to external services, like database, redis, file system. So please write them for repositories, cache drivers, file uploaders etc.
- For functional API tests we use PHPUnit with lchrusciel/api-test-case library. The functional API tests means running application API endpoints, comparing their responses with additional database checks if needed.
- Please write your fixtures using Nelmio Alice package, which is included in lchrusciel/api-test-case library.
- For functional and end to end GUI tests please use Behat.
- After you implement any new functional feature, write Behat scenario (Gherkin,
*.feature
file). - When you're fixing a bug, it's recommended to write behat scenario first (TDD) to prove the fix works correctly.