File tree 1 file changed +14
-5
lines changed
1 file changed +14
-5
lines changed Original file line number Diff line number Diff line change @@ -19,12 +19,9 @@ public function setUp(): void
19
19
20
20
self ::$ documentation ??= $ this ->getJsonFixture ('tmp_data ' );
21
21
22
- if (!is_dir (storage_path ('documentations ' ))) {
23
- mkdir (storage_path ('documentations ' ));
24
- }
25
-
26
- file_put_contents (storage_path ('documentations/documentation.json ' ), json_encode (self ::$ documentation ));
22
+ file_put_contents (storage_path ('documentation.json ' ), json_encode (self ::$ documentation ));
27
23
24
+ config (['auto-doc.drivers.local.directory ' => '' ]);
28
25
config (['auto-doc.drivers.local.base_file_name ' => 'documentation ' ]);
29
26
}
30
27
@@ -44,6 +41,18 @@ public function testGetJSONDocumentation()
44
41
$ response ->assertJson (self ::$ documentation );
45
42
}
46
43
44
+ public function testGetJSONDocumentationWithFilledDirectory ()
45
+ {
46
+ file_put_contents (storage_path ('documentations/documentation.json ' ), json_encode (self ::$ documentation ));
47
+ config (['auto-doc.drivers.local.directory ' => 'documentations ' ]);
48
+
49
+ $ response = $ this ->json ('get ' , '/auto-doc/documentation ' );
50
+
51
+ $ response ->assertStatus (Response::HTTP_OK );
52
+
53
+ $ response ->assertJson (self ::$ documentation );
54
+ }
55
+
47
56
public function testGetJSONDocumentationWithAdditionalPaths ()
48
57
{
49
58
config ([
You can’t perform that action at this time.
0 commit comments