forked from BookStackApp/BookStack
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathApiDocsTest.php
More file actions
34 lines (28 loc) · 926 Bytes
/
ApiDocsTest.php
File metadata and controls
34 lines (28 loc) · 926 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<?php
namespace Tests\Api;
use Tests\TestCase;
class ApiDocsTest extends TestCase
{
use TestsApi;
protected $endpoint = '/api/docs';
public function test_docs_page_returns_view_with_docs_content()
{
$resp = $this->actingAsApiEditor()->get($this->endpoint);
$resp->assertStatus(200);
$resp->assertSee(url('/api/docs.json'));
$resp->assertSee('Show a JSON view of the API docs data.');
$resp->assertHeader('Content-Type', 'text/html; charset=UTF-8');
}
public function test_docs_json_endpoint_returns_json()
{
$resp = $this->actingAsApiEditor()->get($this->endpoint . '.json');
$resp->assertStatus(200);
$resp->assertHeader('Content-Type', 'application/json');
$resp->assertJson([
'docs' => [[
'name' => 'docs-display',
'uri' => 'api/docs',
]],
]);
}
}