fix gitlab tests
This commit is contained in:
@@ -11,14 +11,15 @@ class ApiClientCompatibilityVersioningContractTest extends FullSurfaceE2EContrac
|
||||
{
|
||||
$allowedUnversioned = [
|
||||
'api/login', 'api/logout', 'api/user', 'api/register', 'api/forgot-password', 'api/reset-password',
|
||||
'api/docs', 'api/health', 'api/db-check', 'api/badge-scan', 'api/scanner',
|
||||
'api/docs', 'api/documentation', 'api/health', 'api/db-check', 'api/badge-scan', 'api/scanner',
|
||||
'api/emails', 'api/compare',
|
||||
'api/attendance-templates', 'api/attendance-comment-templates', 'api/administrator/attendance-templates',
|
||||
];
|
||||
|
||||
foreach ($this->apiRoutes() as $route) {
|
||||
$uri = $route->uri();
|
||||
if (str_starts_with($uri, 'api/v1/')) {
|
||||
$this->assertTrue(true);
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -32,7 +33,7 @@ class ApiClientCompatibilityVersioningContractTest extends FullSurfaceE2EContrac
|
||||
|
||||
$this->assertTrue(
|
||||
$isAllowed,
|
||||
$uri.' is an unversioned API route. If this is deliberate legacy support, add it to the explicit allow-list.'
|
||||
$uri . ' is an unversioned API route. If this is deliberate legacy support, add it to the explicit allow-list.'
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -46,8 +47,8 @@ class ApiClientCompatibilityVersioningContractTest extends FullSurfaceE2EContrac
|
||||
continue;
|
||||
}
|
||||
|
||||
$key = $name.'|'.$this->primaryMethod($route);
|
||||
$this->assertArrayNotHasKey($key, $seen, 'Duplicate API route name/method pair: '.$key.' for '.$route->uri().' and '.($seen[$key] ?? 'unknown'));
|
||||
$key = $name . '|' . $this->primaryMethod($route);
|
||||
$this->assertArrayNotHasKey($key, $seen, 'Duplicate API route name/method pair: ' . $key . ' for ' . $route->uri() . ' and ' . ($seen[$key] ?? 'unknown'));
|
||||
$seen[$key] = $route->uri();
|
||||
}
|
||||
}
|
||||
@@ -63,10 +64,10 @@ class ApiClientCompatibilityVersioningContractTest extends FullSurfaceE2EContrac
|
||||
$legacyResponse = $this->postJson($legacy, ['email' => 'bad@example.test', 'password' => 'wrong']);
|
||||
$currentResponse = $this->postJson($current, ['email' => 'bad@example.test', 'password' => 'wrong']);
|
||||
|
||||
$this->assertNoServerError($legacyResponse, $legacy.' legacy auth failure');
|
||||
$this->assertNoServerError($currentResponse, $current.' current auth failure');
|
||||
$this->assertStatusIn($legacyResponse, [400, 401, 403, 419, 422], $legacy.' legacy auth failure');
|
||||
$this->assertStatusIn($currentResponse, [400, 401, 403, 419, 422], $current.' current auth failure');
|
||||
$this->assertNoServerError($legacyResponse, $legacy . ' legacy auth failure');
|
||||
$this->assertNoServerError($currentResponse, $current . ' current auth failure');
|
||||
$this->assertStatusIn($legacyResponse, [400, 401, 403, 419, 422], $legacy . ' legacy auth failure');
|
||||
$this->assertStatusIn($currentResponse, [400, 401, 403, 419, 422], $current . ' current auth failure');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user