Skip to content

Commit 2ea8bd5

Browse files
authored
Merge pull request #256 from remicollet/issue-not-git
skip tests requiring git repository
2 parents b52d30b + e889730 commit 2ea8bd5

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

tests/Core/Filters/GitModifiedTest.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,10 @@ public static function dataAcceptOnlyGitModified()
211211
*/
212212
public function testExecAlwaysReturnsArray($cmd, $expected)
213213
{
214+
if (is_dir(__DIR__.'/../../../.git') === false) {
215+
$this->markTestSkipped('Not a git repository');
216+
}
217+
214218
$fakeDI = new RecursiveArrayIterator(self::getFakeFileList());
215219
$filter = new GitModified($fakeDI, '/', self::$config, self::$ruleset);
216220

tests/Core/Filters/GitStagedTest.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,10 @@ public static function dataAcceptOnlyGitStaged()
211211
*/
212212
public function testExecAlwaysReturnsArray($cmd, $expected)
213213
{
214+
if (is_dir(__DIR__.'/../../../.git') === false) {
215+
$this->markTestSkipped('Not a git repository');
216+
}
217+
214218
$fakeDI = new RecursiveArrayIterator(self::getFakeFileList());
215219
$filter = new GitStaged($fakeDI, '/', self::$config, self::$ruleset);
216220

0 commit comments

Comments
 (0)