41 lines
1.4 KiB
PHP
41 lines
1.4 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace Tests\Architecture;
|
|
|
|
use Tests\Architecture\Support\ArchitectureTestCase;
|
|
|
|
final class HttpRuntimeBoundaryTest extends ArchitectureTestCase
|
|
{
|
|
public function testKernelHttpApplicationContainsOnlyTransverseHttpContracts(): void
|
|
{
|
|
$path = $this->projectPath('src/Kernel/Http/Application');
|
|
self::assertDirectoryExists($path);
|
|
|
|
$entries = array_values(array_filter(scandir($path) ?: [], static fn (string $entry): bool => !in_array($entry, ['.', '..'], true)));
|
|
sort($entries);
|
|
|
|
self::assertSame([
|
|
'Flash',
|
|
'Session',
|
|
], $entries, 'Kernel/Http/Application should only expose transverse HTTP contracts.');
|
|
}
|
|
|
|
public function testKernelRuntimeHttpContainsOnlyApprovedAssemblyClasses(): void
|
|
{
|
|
$path = $this->projectPath('src/Kernel/Runtime/Http');
|
|
self::assertDirectoryExists($path);
|
|
|
|
$entries = array_values(array_filter(scandir($path) ?: [], static fn (string $entry): bool => !in_array($entry, ['.', '..'], true)));
|
|
sort($entries);
|
|
|
|
self::assertSame([
|
|
'DefaultErrorHandler.php',
|
|
'ErrorHandlerConfigurator.php',
|
|
'HttpApplicationFactory.php',
|
|
'MiddlewareRegistrar.php',
|
|
], $entries, 'Kernel/Runtime/Http should contain only the approved HTTP runtime assembly classes.');
|
|
}
|
|
}
|