With https://github.com/laravel/framework/pull/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:
I tried to mock ConsoleOutput instead but it's not that simple as the output stream at ConsoleOutput is done on private methods.
Create a Command that uses table() and tests it asserting the exit code.
Fixed in 6.15.1.
Thanks for the quick fix, though I think this error still occurs when the test has the mockConsoleOutput property set to false.
@adam-prickett
Can confirm, as @tbuteler said, it is not working when testing commands with mockConsoleOutputis set to false within test.
Call to undefined method Symfony\Component\Console\Output\BufferedOutput::section()
in file /.../vendor/laravel/framework/src/Illuminate/Console/Concerns/InteractsWithIO.php (225)
Downgrading to 6.14.0 worked like charm.
@tbuteler @stefanullrich I鈥檓 going to take a look at this issue this evening and see if I can patch
I side with @stefanullrich. I just upgraded from v6.11.0 => v6.15.1 and Artisan::output() broke. Now some tests fail.
Error: Call to undefined method Symfony\Component\Console\Output\BufferedOutput::section()
It also broke my tests, somehow:

See here:
https://github.com/JosephSilber/bouncer/runs/443733143?check_suite_focus=true
It fails at this line:
@JosephSilber
Can you check if the tests breaking on v6.15.0 and also v6.15.1.
I'm not sure how the test would fail on your case since I can't find that the code using table(), it might be best to debug if it's related to changes to PendingCommand code in v6.15.1 (and also why it's failing in 7.4 only).
@crynobone you're right. Bouncer's failing test has nothing to do with this (nor with PendingCommand), since it now also fails on Laravel 6.0.0.
It must be a different dependency that was updated. I'll have to investigate and track that down.
Sorry for adding to the noise here.
We've reverted the entire feature for now because of all the problems popping up.
Most helpful comment
@tbuteler @stefanullrich I鈥檓 going to take a look at this issue this evening and see if I can patch