Skip to content

Commit b57b2fa

Browse files
committed
Add test
1 parent 1d87cb9 commit b57b2fa

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

tests/Controllers/LaravelRequestDocsControllerTest.php

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,23 @@ public function testApi()
2020
->assertStatus(Response::HTTP_OK);
2121
}
2222

23+
public function testApiCanHideMetadata()
24+
{
25+
Config::set('request-docs.hide_meta_data', true);
26+
27+
$response = $this->get(route('request-docs.api'))
28+
->assertStatus(Response::HTTP_OK);
29+
30+
$docs = collect($response->json());
31+
32+
$this->assertEmpty($docs->pluck('middlewares')->flatten()->toArray());
33+
$this->assertSame([''], $docs->pluck('controller')->flatten()->unique()->toArray());
34+
$this->assertSame([''], $docs->pluck('controller_full_path')->flatten()->unique()->toArray());
35+
$this->assertSame([''], $docs->pluck('method')->flatten()->unique()->toArray());
36+
$this->assertSame([''], $docs->pluck('doc_block')->flatten()->unique()->toArray());
37+
$this->assertEmpty($docs->pluck('rules')->flatten()->toArray());
38+
}
39+
2340
public function testAbleFetchAllMethods()
2441
{
2542
$response = $this->get(route('request-docs.api'))

0 commit comments

Comments
 (0)