first commit
This commit is contained in:
40
tests/Architecture/HttpRuntimeBoundaryTest.php
Normal file
40
tests/Architecture/HttpRuntimeBoundaryTest.php
Normal file
@@ -0,0 +1,40 @@
|
||||
<?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.');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user