From b4dd5d832e49eaf641edd5831895757ae4e80a77 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Fri, 12 Jan 2024 08:38:18 +0100 Subject: update to 3.8.1 add patch for test suite from https://github.com/PHPCSStandards/PHP_CodeSniffer/pull/256 --- 0001-skip-tests-requiring-git-repository.patch | 41 ++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 0001-skip-tests-requiring-git-repository.patch (limited to '0001-skip-tests-requiring-git-repository.patch') diff --git a/0001-skip-tests-requiring-git-repository.patch b/0001-skip-tests-requiring-git-repository.patch new file mode 100644 index 0000000..d79dbd5 --- /dev/null +++ b/0001-skip-tests-requiring-git-repository.patch @@ -0,0 +1,41 @@ +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 + -- cgit