Closed hotrush closed 4 years ago
@wolfy-j any workaround i can use to call command from test case?
Hi, I haven't created these traits so it will take me some time to fix them. But you can invoke the run
method of console dispatcher:
https://github.com/spiral/app/blob/master/tests/Traits/InteractsWithConsole.php#L25
I assume that all you need to do is to implement console
method in TestApp
which:
use Spiral\Console\Console;
// ...
public function console()
{
return $this->get(Console::class);
}
That works, thanks
Just try to create an app using this skeleton, go to
TestCase
class and add$this->runCommand('test');
intosetUp
method: