$logger =
$this->
createMock(LoggerInterface::
class);
$logger ->
expects($this->
exactly(3
)) ->
method('debug'
) ->
with('Command "{command}" exited with code "{code}"',
['command' => 'test:run --foo=bar', 'code' => 255
]) ;
$listener =
new ErrorListener($logger);
$listener->
onConsoleTerminate($this->
getConsoleTerminateEvent(new ArgvInput(['console.php', 'test:run', '--foo=bar'
]), 255
));
$listener->
onConsoleTerminate($this->
getConsoleTerminateEvent(new ArrayInput(['name' => 'test:run', '--foo' => 'bar'
]), 255
));
$listener->
onConsoleTerminate($this->
getConsoleTerminateEvent(new StringInput('test:run --foo=bar'
), 255
));
} public function testCommandNameIsDisplayedForNonStringableInput() { $logger =
$this->
createMock(LoggerInterface::
class);
$logger ->
expects($this->
once()) ->
method('debug'
) ->
with('Command "{command}" exited with code "{code}"',
['command' => 'test:run', 'code' => 255
]) ;