| Conditions | 1 |
| Paths | 1 |
| Total Lines | 15 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 18 | public function testPreCommitSuccess(): void |
||
| 19 | { |
||
| 20 | $repoPath = $this->setUpRepository(); |
||
| 21 | |||
| 22 | $this->enableHook($repoPath, 'pre-commit', [ |
||
| 23 | ['action' => 'echo "test action placeholder {$STAGED_FILES|of-type:html}" > html.log'] |
||
| 24 | ]); |
||
| 25 | |||
| 26 | $this->filesystem()->touch($repoPath . '/foo.html'); |
||
| 27 | $this->mustRunInShell(['git', 'add', 'foo.html'], $repoPath); |
||
| 28 | $this->mustRunInShell(['git', 'commit', '-m', 'Test successful pre-commit execution'], $repoPath); |
||
| 29 | |||
| 30 | $log = file_get_contents($repoPath . '/html.log'); |
||
| 31 | |||
| 32 | $this->assertStringContainsString("foo.html", $log); |
||
| 33 | } |
||
| 35 |