samedi 6 avril 2019

Debug console command output when running tests | Laravel

I'm trying to debug console command with a progress bar.

Here is my command

\Artisan::command('demo', function (){
    $bar = $this->output->createProgressBar(5);
    $bar->advance();
    $this->line('text');
    $bar->finish();
});

And how I call it in test(I'm using orchestra/testbench)

$this->withoutMockingConsoleOutput()->artisan('demo');

How I can see a progress bar for debugging purposes?

It's a package so I can't call command with php artisan demo

Aucun commentaire:

Enregistrer un commentaire