Files
alrahma_sunday_school_api/tests/Feature/Api/V1/FullSurface/ApiBatch17MultiGuardBoundaryContractTest.php
T
2026-06-09 01:03:53 -04:00

29 lines
1.0 KiB
PHP

<?php
namespace Tests\Feature\Api\V1\FullSurface;
use Tests\Feature\Api\V1\FullSurface\Support\FullSurfaceE2EContractCase;
class ApiBatch17MultiGuardBoundaryContractTest extends FullSurfaceE2EContractCase
{
public function test_api_guard_boundaries_are_not_crossed_by_session_or_web_identity(): void
{
$routes = $this->apiRoutesContainingAny(['admin', 'users', 'finance', 'settings', 'school-years', 'inventory']);
foreach (array_slice($routes, 0, 70) as $route) {
$method = $this->primaryMethod($route);
$uri = $route->uri();
$this->actingAs($this->parent, 'web');
$response = $this->json($method, $this->materializePath($uri), $this->payloadFor($method, $uri), [
'Accept' => 'application/json',
'X-Requested-With' => 'XMLHttpRequest',
]);
$this->assertControlled($response, $method, $uri);
$this->assertNotEquals(500, $response->getStatusCode(), $method.' '.$uri.' crashed under web guard identity.');
}
}
}