Architecture testing for PHP

ArchUnitPHP

The PHP foundation focuses on static source analysis, honest Composer autoload resolution, lazy immutable rules, and structured violations. It is designed to integrate with PHPUnit and Pest without coupling the core to either.

Foundation stagePHP ecosystemTo be finalized

Roadmap

Follow the public foundation backlog
ArchitectureTest.php
$rule = ArchUnit::projectFiles()
    ->inFolder('src/Api/**')
    ->shouldNot()
    ->dependOnFiles()
    ->inFolder('src/Infrastructure/**');

ArchAssert::passes($rule);

Capabilities

What ArchUnitPHP brings to the test suite.

The family shares a recognizable architecture vocabulary while each implementation stays honest about its language, toolchain, and maturity.

01

Static analysis without loading the application

02

Composer autoloading and symbol resolution

03

Lazy and immutable rule builders

04

PHPUnit and Pest integration targets

05

Structured violations

06

Pure graph and end-to-end test boundaries

Current maturity

Foundation stage

A public delivery skeleton and design target, not a Composer package or released API yet.

LanguagePHP
ReleasePlanned
RuntimePHP ecosystem
LicenseTo be finalized

Where it fits

Put boundaries next to the code they protect.

Common starting points for ArchUnitPHP include the following project shapes.

Laravel projectsSymfony servicesComposer librariesLegacy PHP

Make the first boundary executable.

Add one meaningful rule, run it with the existing tests, and grow the architecture suite as the system reveals where it needs protection.

Start with ArchUnitPHP ↗