false, 'app.swagger_enabled' => true, ]); foreach ([ '/swagger/json', '/api/documentation', '/docs', '/docs/asset/swagger-ui.css', '/docs/api-docs.json', '/docs/api-docs.yaml', '/swagger/index.html', '/swagger/swagger-ui.js', '/storage/api-docs/api-docs.json', ] as $path) { $response = $this->get($path); $response->assertNotFound(); $this->assertStringNotContainsString('openapi', strtolower($response->getContent())); $this->assertStringNotContainsString('swagger', strtolower($response->getContent())); } } public function test_documentation_can_be_enabled_in_a_debug_test_environment(): void { config([ 'app.debug' => true, 'app.swagger_enabled' => true, ]); $response = $this->get('/swagger/json'); $response->assertOk(); $response->assertJsonStructure(['openapi', 'paths']); } }