first commit

This commit is contained in:
julien
2026-03-20 22:13:41 +01:00
commit 41f8b3afb4
323 changed files with 27222 additions and 0 deletions

View File

@@ -0,0 +1,67 @@
<?php
declare(strict_types=1);
namespace Tests\Architecture;
use Tests\Architecture\Support\ArchitectureTestCase;
final class LayerDependencyTest extends ArchitectureTestCase
{
public function testDomainLayerDoesNotDependOnApplicationInfrastructureOrUi(): void
{
$this->assertFilesDoNotReferenceFragments(
$this->domainFiles(),
array_merge(
self::APPLICATION_NAMESPACES,
self::INFRASTRUCTURE_NAMESPACES,
self::UI_NAMESPACES,
self::FRAMEWORK_NAMESPACE_FRAGMENTS,
self::HTTP_MESSAGE_DEPENDENCIES,
),
self::MESSAGE_DOMAIN_FRAMEWORK_AGNOSTIC,
);
}
public function testApplicationLayerDoesNotDependOnUiInfrastructureOrHttpUploadedFiles(): void
{
$this->assertFilesDoNotReferenceFragments(
$this->applicationFiles(),
array_merge(
$this->applicationMustNotDependOnInfrastructureFragments(),
self::UI_NAMESPACES,
self::APPLICATION_RUNTIME_DETAIL_FRAGMENTS,
self::HTTP_MESSAGE_DEPENDENCIES,
self::FRAMEWORK_NAMESPACE_FRAGMENTS,
),
self::MESSAGE_APPLICATION_PORTS_ONLY,
);
}
public function testApplicationLayerDoesNotDependOnInfrastructureImplementations(): void
{
$this->assertFilesDoNotReferenceFragments(
$this->applicationFiles(),
$this->applicationMustNotDependOnInfrastructureFragments(),
self::MESSAGE_APPLICATION_NO_INFRA_DEPENDENCY,
);
}
public function testUiLayerDoesNotDependOnInfrastructureImplementations(): void
{
$this->assertFilesDoNotReferenceFragments(
$this->uiFiles(),
$this->uiMustNotDependOnInfrastructureFragments(),
self::MESSAGE_UI_NO_INFRA_DEPENDENCY,
);
}
public function testInfrastructureLayerDoesNotDependOnUi(): void
{
$this->assertFilesDoNotReferenceFragments(
$this->nonWiringInfrastructureFiles(),
$this->infrastructureMustNotDependOnUiFragments(),
self::MESSAGE_INFRA_NO_UI_DEPENDENCY,
);
}
}