| @@ 67-87 (lines=21) @@ | ||
| 64 | /** |
|
| 65 | * @test |
|
| 66 | */ |
|
| 67 | public function itShouldWorksFine() |
|
| 68 | { |
|
| 69 | $output = new PreCommitOutputWriter(PhpCsTool::EXECUTE_MESSAGE); |
|
| 70 | $files = FilesCommittedStub::createOnlyPhpFiles(); |
|
| 71 | ||
| 72 | $this->shouldWriteOutput($output->getMessage()); |
|
| 73 | ||
| 74 | foreach ($files as $file) { |
|
| 75 | $this->shouldProcessPhpCsTool($file, 'PSR2', null); |
|
| 76 | } |
|
| 77 | ||
| 78 | $this->shouldWriteLnOutput($output->getSuccessfulMessage()); |
|
| 79 | ||
| 80 | $this->phpCsToolCommandHandler->handle( |
|
| 81 | new PhpCsToolCommand( |
|
| 82 | $files, |
|
| 83 | 'PSR2', |
|
| 84 | HookQuestions::PRE_COMMIT_ERROR_MESSAGE_DEFAULT |
|
| 85 | ) |
|
| 86 | ); |
|
| 87 | } |
|
| 88 | } |
|
| 89 | ||
| @@ 62-78 (lines=17) @@ | ||
| 59 | /** |
|
| 60 | * @test |
|
| 61 | */ |
|
| 62 | public function itShouldWorksFine() |
|
| 63 | { |
|
| 64 | $phpFiles = FilesCommittedStub::createOnlyPhpFiles(); |
|
| 65 | $outputMessage = new PreCommitOutputWriter(PhpLintTool::RUNNING_PHPLINT); |
|
| 66 | ||
| 67 | $this->shouldWriteOutput($outputMessage->getMessage()); |
|
| 68 | ||
| 69 | foreach ($phpFiles as $file) { |
|
| 70 | $this->shouldProcessPhpLintTool($file, null); |
|
| 71 | } |
|
| 72 | ||
| 73 | $this->shouldWriteLnOutput($outputMessage->getSuccessfulMessage()); |
|
| 74 | ||
| 75 | $this->phpLintToolCommandHandler->handle( |
|
| 76 | new PhpLintToolCommand($phpFiles, HookQuestions::PRE_COMMIT_ERROR_MESSAGE_DEFAULT) |
|
| 77 | ); |
|
| 78 | } |
|
| 79 | } |
|
| 80 | ||