It is possible to generate a test via
./console generate:test. So far it is possible to generate a unit, database and integration test case. It would be nice to have the possibility to choose "command" as well. This would make it much easier to write tests for a command and the easier it is, the more likely we are writing tests for commands. Makes it also easier for plugin developers.
An example for such a command test is here: https://github.com/piwik/plugin-PiwikDebugger/blob/master/tests/Unit/ListEventObserversTest.php I think.
Alternatively, - maybe this is even better - when generating a command, we could also directly create a test file for this command. So we would kinda automatically write a test for it (maybe ;) ). Therefore we could create a test example in "ExampleCommand" plugin
Feel free to modify ConsoleCommandTestCase (it's in core). Never got around to doing anything serious w/ it, and I doubt I will at this point.
I'm ok with ConsoleCommandTestCase. It's only about providing a generator for it so that we do not have to create a file manually. Also plugin developers would probably not know such a test case exist and need some guidance
mid term though it seems important even for us to write tests easily...