Skip to content

Testing

Phexium employs a three-level testing strategy: unit tests, integration tests, and acceptance tests.

In This Section

Test Categories

Type Framework Location Purpose
Unit Pest PHP tests/*/Unit/ Isolated class testing
Integration Pest PHP tests/*/Integration/ Component interactions
Acceptance Behat tests/*/Acceptance/ User scenarios (BDD)

Running Tests

# Unit tests
task tests:unit

# Integration tests
task tests:integration

# Acceptance tests
task tests:acceptance              # All implementations
task tests:acceptance:inmemory     # Fastest (no database)

# All tests with merged coverage
task tests:all

# Mutation testing
task tests:mutation

Code Coverage

The merged code coverage report is published on GitLab Pages after each CI pipeline run on the trunk branch.

View coverage report:

coverage report

To generate the report locally:

task tests:coverage:merge

The HTML report is generated in public/debug/code-coverage/.

Configuration Files

  • phpunit.xml - Pest/PHPUnit configuration
  • behat.yml - Behat acceptance test suites
  • tests/Pest.php - Pest bootstrap