public function itShouldThrowsException()
{
$this->expectException(PhpLintViolationsException::class);
$phpFiles = FilesCommittedStub::createOnlyPhpFiles();
$outputMessage = new PreCommitOutputWriter(PhpLintTool::RUNNING_PHPLINT);
$errorMessage = PreCommitResponseStub::FIX_YOUR_CODE;
$this->shouldWriteOutput($outputMessage->getMessage());
$errors = null;
foreach ($phpFiles as $file) {
$error = 'ERROR';
$this->shouldProcessPhpLintTool($file, $error);
$errors .= $error;
}
$this->shouldWriteLnOutput($outputMessage->getFailMessage());
$this->shouldWriteLnOutput($outputMessage->setError($errors));
$this->shouldWriteLnOutput(BadJobLogoResponse::paint($errorMessage));
$this->phpLintToolCommandHandler->handle(new PhpLintToolCommand($phpFiles, $errorMessage));
}