Skip to content

Commit 91aba99

Browse files
committed
tests: fix test fixtures;
1 parent 35d1c2f commit 91aba99

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

config/auto-doc.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
| In case your app available at https://some.domain.com/service - use
2525
| /service as global prefix config
2626
*/
27-
'global_prefix' => env('SWAGGER_GLOBAL_PREFIX', '/'),
27+
'global_prefix' => env('SWAGGER_GLOBAL_PREFIX', ''),
2828

2929
/*
3030
|--------------------------------------------------------------------------

tests/AutoDocControllerTest.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,13 @@ public function setUp(): void
2121
config(['auto-doc.drivers.local.production_path' => $this->localDriverFilePath]);
2222
}
2323

24+
public function tearDown(): void
25+
{
26+
putenv('SWAGGER_GLOBAL_PREFIX=');
27+
28+
parent::tearDown();
29+
}
30+
2431
public function testGetJSONDocumentation()
2532
{
2633
$response = $this->json('get', '/auto-doc/documentation');

tests/fixtures/AutoDocControllerTest/rendered_documentation.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,11 @@
3636
<script src="/auto-doc/swagger-ui-bundle.js" charset="UTF-8"> </script>
3737
<script src="/auto-doc/swagger-ui-standalone-preset.js" charset="UTF-8"> </script>
3838
<script>
39-
const prefix = '/';
39+
const prefix = '';
4040

4141
window.onload = () => {
4242
const ui = SwaggerUIBundle({
43-
url: `${prefix}auto-doc/documentation`,
43+
url: `${prefix}/auto-doc/documentation`,
4444
dom_id: '#swagger-ui',
4545
deepLinking: true,
4646
defaultModelRendering: 'model',

0 commit comments

Comments
 (0)