first commit
This commit is contained in:
67
tests/Architecture/LayerDependencyTest.php
Normal file
67
tests/Architecture/LayerDependencyTest.php
Normal 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,
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user