fix tests

This commit is contained in:
root
2026-06-11 11:46:12 -04:00
parent c91fa2ce4d
commit 5ead80fdc7
1489 changed files with 11349 additions and 10305 deletions
@@ -12,9 +12,9 @@ use Tests\TestCase;
*/
class ApiPublicAndAuthFullSurfaceContractTest extends TestCase
{
use AssertsE2EApiResponses;
use RefreshDatabase;
use SeedsE2ETestFixtures;
use AssertsE2EApiResponses;
public function test_public_and_auth_surface_has_stable_contracts(): void
{
@@ -23,14 +23,14 @@ class ApiPublicAndAuthFullSurfaceContractTest extends TestCase
foreach ($this->publicGetEndpoints() as $uri) {
$response = $this->getJson($uri);
$this->assertNoServerError($response, 'Public GET ' . $uri);
$this->assertStatusIn($response, [200, 302, 400, 401, 403, 404, 419, 422], 'Public GET ' . $uri);
$this->assertNoServerError($response, 'Public GET '.$uri);
$this->assertStatusIn($response, [200, 302, 400, 401, 403, 404, 419, 422], 'Public GET '.$uri);
}
foreach ($this->publicPostEndpoints() as [$uri, $payload]) {
$response = $this->postJson($uri, $payload);
$this->assertNoServerError($response, 'Public POST ' . $uri);
$this->assertStatusIn($response, [200, 201, 202, 302, 400, 401, 403, 404, 419, 422], 'Public POST ' . $uri);
$this->assertNoServerError($response, 'Public POST '.$uri);
$this->assertStatusIn($response, [200, 201, 202, 302, 400, 401, 403, 404, 419, 422], 'Public POST '.$uri);
}
$login = $this->postJson('/api/v1/auth/login', ['email' => $admin->email, 'password' => 'password']);
@@ -40,8 +40,8 @@ class ApiPublicAndAuthFullSurfaceContractTest extends TestCase
$this->actingAs($admin, 'api');
foreach (['/api/v1/auth/me', '/api/v1/frontend/me', '/api/v1/auth/logout'] as $uri) {
$response = str_ends_with($uri, 'logout') ? $this->postJson($uri) : $this->getJson($uri);
$this->assertNoServerError($response, 'Authenticated auth/frontend endpoint ' . $uri);
$this->assertStatusIn($response, [200, 204, 401, 403, 419, 422], 'Authenticated auth/frontend endpoint ' . $uri);
$this->assertNoServerError($response, 'Authenticated auth/frontend endpoint '.$uri);
$this->assertStatusIn($response, [200, 204, 401, 403, 419, 422], 'Authenticated auth/frontend endpoint '.$uri);
}
}