LaravelGeneratorTest.php 751 B

123456789101112131415161718192021222324252627282930
  1. <?php
  2. namespace Mpociot\ApiDoc\Tests\Unit;
  3. use Illuminate\Routing\Route;
  4. use Mpociot\ApiDoc\Generators\LaravelGenerator;
  5. use Mpociot\ApiDoc\Tests\Fixtures\TestController;
  6. use Mpociot\ApiDoc\ApiDocGeneratorServiceProvider;
  7. class LaravelGeneratorTest extends GeneratorTestCase
  8. {
  9. protected function getPackageProviders($app)
  10. {
  11. return [
  12. ApiDocGeneratorServiceProvider::class,
  13. ];
  14. }
  15. public function setUp()
  16. {
  17. parent::setUp();
  18. $this->generator = new LaravelGenerator();
  19. }
  20. public function createRoute(string $httpMethod, string $path, string $controllerMethod)
  21. {
  22. return new Route([$httpMethod], $path, ['uses' => TestController::class . "@$controllerMethod"]);
  23. }
  24. }