Skip to content

[6.x] Console Command Test with table() is broken #31445

Closed
@dbpolito

Description

@dbpolito
  • Laravel Version: 6.x
  • PHP Version: 7.3.14 (not relevant)
  • Database Driver & Version: (not relevant)

Description:

With #31426 now any command that uses table() is breaking on tests, the reason is at testing we mock a BufferedOutput and not a ConsoleOutput, which has section() method:

https://github.com/laravel/framework/blob/6.x/src/Illuminate/Foundation/Testing/PendingCommand.php#L185-L207

I tried to mock ConsoleOutput instead but it's not that simple as the output stream at ConsoleOutput is done on private methods.

Steps To Reproduce:

Create a Command that uses table() and tests it asserting the exit code.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions