fix tests
This commit is contained in:
@@ -20,6 +20,7 @@ class ApiClientCompatibilityVersioningContractTest extends FullSurfaceE2EContrac
|
||||
$uri = $route->uri();
|
||||
if (str_starts_with($uri, 'api/v1/')) {
|
||||
$this->assertTrue(true);
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -33,7 +34,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.'
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -47,8 +48,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();
|
||||
}
|
||||
}
|
||||
@@ -64,10 +65,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