From 472b4f7c56dd95ca4469ed5aad6d6620aa13e03e Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Fri, 12 Jan 2024 08:25:58 +0100 Subject: [PATCH] skip tests requiring git repository --- tests/Core/Filters/GitModifiedTest.php | 3 +++ tests/Core/Filters/GitStagedTest.php | 3 +++ 2 files changed, 6 insertions(+) diff --git a/tests/Core/Filters/GitModifiedTest.php b/tests/Core/Filters/GitModifiedTest.php index 626fb6531..ca068e144 100644 --- a/tests/Core/Filters/GitModifiedTest.php +++ b/tests/Core/Filters/GitModifiedTest.php @@ -211,6 +211,9 @@ final class GitModifiedTest extends AbstractFilterTestCase */ public function testExecAlwaysReturnsArray($cmd, $expected) { + if (!is_dir(__DIR__ . '/../../../.git')) { + $this->markTestSkipped('Not a git repository'); + } $fakeDI = new RecursiveArrayIterator(self::getFakeFileList()); $filter = new GitModified($fakeDI, '/', self::$config, self::$ruleset); diff --git a/tests/Core/Filters/GitStagedTest.php b/tests/Core/Filters/GitStagedTest.php index 0009aefa7..cf5f69765 100644 --- a/tests/Core/Filters/GitStagedTest.php +++ b/tests/Core/Filters/GitStagedTest.php @@ -211,6 +211,9 @@ final class GitStagedTest extends AbstractFilterTestCase */ public function testExecAlwaysReturnsArray($cmd, $expected) { + if (!is_dir(__DIR__ . '/../../../.git')) { + $this->markTestSkipped('Not a git repository'); + } $fakeDI = new RecursiveArrayIterator(self::getFakeFileList()); $filter = new GitStaged($fakeDI, '/', self::$config, self::$ruleset); -- 2.43.0