|
21 | 21 | use RonasIT\Support\AutoDoc\Exceptions\SpecValidation\MissingPathPlaceholderException; |
22 | 22 | use RonasIT\Support\AutoDoc\Exceptions\SpecValidation\MissingRefFileException; |
23 | 23 | use RonasIT\Support\AutoDoc\Exceptions\SwaggerDriverClassNotFoundException; |
| 24 | +use RonasIT\Support\AutoDoc\Exceptions\UnsupportedDocumentationViewerException; |
24 | 25 | use RonasIT\Support\AutoDoc\Exceptions\WrongSecurityConfigException; |
25 | 26 | use RonasIT\Support\AutoDoc\Services\SwaggerService; |
26 | 27 | use RonasIT\Support\Tests\Support\Mock\TestNotificationSetting; |
@@ -649,4 +650,30 @@ public function testAddDataWithoutBoundContract() |
649 | 650 |
|
650 | 651 | $service->addData($request, $response); |
651 | 652 | } |
| 653 | + |
| 654 | + public function testSetInvalidDocumentationViewer() |
| 655 | + { |
| 656 | + config(['auto-doc.documentation_viewer' => 'invalid']); |
| 657 | + |
| 658 | + $this->expectException(UnsupportedDocumentationViewerException::class); |
| 659 | + $this->expectExceptionMessage( |
| 660 | + "The documentation viewer 'invalid' does not exists." |
| 661 | + . " Please check that the 'documentation_viewer' key of your auto-doc.php config has one of valid values." |
| 662 | + ); |
| 663 | + |
| 664 | + app(SwaggerService::class); |
| 665 | + } |
| 666 | + |
| 667 | + public function testSetNullableDocumentationViewer() |
| 668 | + { |
| 669 | + config(['auto-doc.documentation_viewer' => null]); |
| 670 | + |
| 671 | + $this->expectException(UnsupportedDocumentationViewerException::class); |
| 672 | + $this->expectExceptionMessage( |
| 673 | + "The documentation viewer '' does not exists." |
| 674 | + . " Please check that the 'documentation_viewer' key of your auto-doc.php config has one of valid values." |
| 675 | + ); |
| 676 | + |
| 677 | + app(SwaggerService::class); |
| 678 | + } |
652 | 679 | } |
0 commit comments