LaravelGeneratorTest.php 884 B

123456789101112131415161718192021222324
  1. <?php
  2. namespace Knuckles\Scribe\Tests\Unit;
  3. use Illuminate\Routing\Route;
  4. use Knuckles\Scribe\Tests\Fixtures\TestController;
  5. class LaravelGeneratorTest extends GeneratorTestCase
  6. {
  7. public function createRoute(string $httpMethod, string $path, string $controllerMethod, $register = false, $class = TestController::class)
  8. {
  9. return new Route([$httpMethod], $path, ['uses' => $class . "@$controllerMethod"]);
  10. }
  11. public function createRouteUsesArray(string $httpMethod, string $path, string $controllerMethod, $register = false, $class = TestController::class)
  12. {
  13. return new Route([$httpMethod], $path, ['uses' => [$class, $controllerMethod]]);
  14. }
  15. public function createRouteUsesCallable(string $httpMethod, string $path, callable $handler, $register = false)
  16. {
  17. return new Route([$httpMethod], $path, ['uses' => $handler]);
  18. }
  19. }