Laravel - Console Tests - Table Expectations

If your command displays a table of information using Artisan's table method, it can be cumbersome to write output expectations for the entire table. Instead, you may use the expectsTable method. This method accepts the table's headers as its first argument and the table's data as its second argument:

    
    $this->artisan('users:all')
        ->expectsTable([
            'ID',
            'Email',
        ], [
            [1, '[email protected]'],
            [2, '[email protected]'],
        ]);