@@ -37,6 +37,19 @@ public function testGetJSONDocumentation()
3737 $ response ->assertJson ($ this ->documentation );
3838 }
3939
40+ public function testGetJSONDocumentationWithAdditionalPaths ()
41+ {
42+ config ([
43+ 'auto-doc.additional_paths ' => ['tests/fixtures/AutoDocControllerTest/tmp_data_with_additional_paths.json ' ]
44+ ]);
45+
46+ $ response = $ this ->json ('get ' , '/auto-doc/documentation ' );
47+
48+ $ response ->assertStatus (Response::HTTP_OK );
49+
50+ $ this ->assertEqualsJsonFixture ('tmp_data_with_additional_paths ' , $ response ->json ());
51+ }
52+
4053 public function testGetJSONDocumentationWithGlobalPrefix ()
4154 {
4255 $ this ->addGlobalPrefix ();
@@ -56,7 +69,7 @@ public function testGetViewDocumentation()
5669
5770 $ response ->assertStatus (Response::HTTP_OK );
5871
59- $ this ->assertEquals ( $ response ->getContent (), $ this -> getFixture ( ' rendered_documentation.html ' ));
72+ $ this ->assertEqualsFixture ( ' rendered_documentation.html ' , $ response ->getContent ());
6073 }
6174
6275 public function testGetViewDocumentationEnvironmentDisable ()
@@ -78,7 +91,7 @@ public function testGetViewDocumentationWithGlobalPrefix()
7891
7992 $ response ->assertStatus (Response::HTTP_OK );
8093
81- $ this ->assertEquals ( $ response ->getContent (), $ this -> getFixture ( ' rendered_documentation_with_global_path.html ' ));
94+ $ this ->assertEqualsFixture ( ' rendered_documentation_with_global_path.html ' , $ response ->getContent ());
8295 }
8396
8497 public function testGetSwaggerAssetFile ()
@@ -92,6 +105,13 @@ public function testGetSwaggerAssetFile()
92105 $ response ->assertHeader ('Content-Type ' , 'text/html; charset=UTF-8 ' );
93106 }
94107
108+ public function testGetFileNotExists ()
109+ {
110+ $ response = $ this ->get ('/auto-doc/non-existent-file.js ' );
111+
112+ $ response ->assertStatus (Response::HTTP_NOT_FOUND );
113+ }
114+
95115 public function testGetSwaggerAssetFileWithGlobalPrefix ()
96116 {
97117 $ this ->addGlobalPrefix ();
0 commit comments