From cebc945fbe07b1171c966183e26008e9bc5b72f3 Mon Sep 17 00:00:00 2001 From: Koda Date: Fri, 24 Apr 2026 09:06:45 +0000 Subject: [PATCH] Stabilize Scalar docs response assertions --- tests/Feature/Api/PublicApiDocumentationTest.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/tests/Feature/Api/PublicApiDocumentationTest.php b/tests/Feature/Api/PublicApiDocumentationTest.php index d06a961..361e632 100644 --- a/tests/Feature/Api/PublicApiDocumentationTest.php +++ b/tests/Feature/Api/PublicApiDocumentationTest.php @@ -8,10 +8,13 @@ class PublicApiDocumentationTest extends TestCase { public function test_scalar_api_docs_are_public(): void { - $this->get('/api/docs') - ->assertOk() - ->assertSee('"hideClientButton":true', false) - ->assertSee('"mcp":{"disabled":true}', false); + $response = $this->get('/api/docs') + ->assertOk(); + + $content = (string) $response->getContent(); + + $this->assertMatchesRegularExpression('/"hideClientButton"\s*:\s*true/', $content); + $this->assertMatchesRegularExpression('/"mcp"\s*:\s*\{\s*"disabled"\s*:\s*true\s*\}/', $content); } public function test_openapi_document_is_publicly_served(): void