Skip to content

Latest commit

 

History

History
30 lines (21 loc) · 1.66 KB

testing.md

File metadata and controls

30 lines (21 loc) · 1.66 KB

Testing

Tests are organized by business behavior, not by coverage targets.

  • tests/Unit mirrors deterministic src behavior.
  • tests/Integration exercises adapters with temporary repositories/filesystems and fake HTTP transports.
  • tests/Acceptance exercises public CLI/PHAR behavior.
  • tests/Fixtures stores named reusable fixtures.

Use named PHPUnit data providers for matrices of one business rule, such as version/channel transitions, Conventional Commit parsing, changelog rendering, configuration validation, milestone behavior, artifact validation and exit codes.

Coverage is diagnostic and supports mutation testing. Infection is a quality gate for meaningful domain/application behavior; tests must not be added only to kill mutants.

PHPMD 3 uses the auto-detected phpmd.yml configuration and analyzes src/ against the same unused-code rules as the previous XML ruleset. Run it with composer phpmd. The Rector quality gate first runs rector validate-config to reject deprecated/invalid configuration, then checks source with rector process --dry-run.

PHPStan 2.3 runs at level 8 to check iterable value types and boundary contracts without ignoring errors or weakening runtime PHP 8.3 support.

Mocks are reserved for interaction boundaries where the interaction itself matters. Prefer real domain objects, fakes, temporary filesystems and temporary Git repositories.

The Behat prototype required by the release roadmap must compare readability and maintenance cost against PHPUnit acceptance tests before adoption. Do not duplicate scenarios in both tools.