|
13 | 13 | use Codeception\Lib\Interfaces\PartedModule; |
14 | 14 | use Codeception\Lib\ModuleContainer; |
15 | 15 | use Codeception\Module\Laravel\InteractsWithAuthentication; |
| 16 | +use Codeception\Module\Laravel\InteractsWithConsole; |
16 | 17 | use Codeception\Subscriber\ErrorHandler; |
17 | 18 | use Codeception\TestInterface; |
18 | 19 | use Codeception\Util\ReflectionHelper; |
19 | 20 | use Exception; |
20 | | -use Illuminate\Contracts\Console\Kernel; |
21 | 21 | use Illuminate\Contracts\Routing\UrlGenerator; |
22 | 22 | use Illuminate\Contracts\Session\Session; |
23 | 23 | use Illuminate\Contracts\View\Factory as ViewContract; |
|
35 | 35 | use ReflectionClass; |
36 | 36 | use ReflectionException; |
37 | 37 | use RuntimeException; |
38 | | -use Symfony\Component\Console\Output\OutputInterface; |
39 | 38 | use function is_array; |
40 | 39 |
|
41 | 40 | /** |
|
131 | 130 | class Laravel extends Framework implements ActiveRecord, PartedModule |
132 | 131 | { |
133 | 132 | use InteractsWithAuthentication; |
| 133 | + use InteractsWithConsole; |
134 | 134 |
|
135 | 135 | /** |
136 | 136 | * @var Application |
@@ -426,34 +426,6 @@ public function dontSeeEventTriggered($expected): void |
426 | 426 | } |
427 | 427 | } |
428 | 428 |
|
429 | | - /** |
430 | | - * Call an Artisan command. |
431 | | - * |
432 | | - * ``` php |
433 | | - * <?php |
434 | | - * $I->callArtisan('command:name'); |
435 | | - * $I->callArtisan('command:name', ['parameter' => 'value']); |
436 | | - * ``` |
437 | | - * Use 3rd parameter to pass in custom `OutputInterface` |
438 | | - * |
439 | | - * @param string $command |
440 | | - * @param array $parameters |
441 | | - * @param OutputInterface|null $output |
442 | | - * @return string|void |
443 | | - */ |
444 | | - public function callArtisan(string $command, $parameters = [], OutputInterface $output = null) |
445 | | - { |
446 | | - $console = $this->app->make(Kernel::class); |
447 | | - if (!$output) { |
448 | | - $console->call($command, $parameters); |
449 | | - $output = trim($console->output()); |
450 | | - $this->debug($output); |
451 | | - return $output; |
452 | | - } |
453 | | - |
454 | | - $console->call($command, $parameters, $output); |
455 | | - } |
456 | | - |
457 | 429 | /** |
458 | 430 | * Opens web page using route name and parameters. |
459 | 431 | * |
|
0 commit comments