TestHelpers.php 614 B

12345678910111213141516171819202122232425262728
  1. <?php
  2. namespace Knuckles\Scribe\Tests;
  3. use Illuminate\Contracts\Console\Kernel;
  4. trait TestHelpers
  5. {
  6. /**
  7. * @param string $command
  8. * @param array $parameters
  9. *
  10. * @return mixed
  11. */
  12. public function artisan($command, $parameters = [])
  13. {
  14. /** @var Kernel $kernel */
  15. $kernel = $this->app[Kernel::class];
  16. $kernel->call($command, $parameters);
  17. return $kernel->output();
  18. }
  19. protected function generate(array $flags = []): mixed
  20. {
  21. return $this->artisan('scribe:generate', array_merge(['--no-upgrade-check' => true], $flags));
  22. }
  23. }