From 9df8ae1d38ef3a7e55daa2367e19152abf98d4e3 Mon Sep 17 00:00:00 2001 From: jrfnl Date: Thu, 2 Jan 2020 01:47:40 +0100 Subject: [PATCH] Generic/ExecutableFile: skip tests on Windows Windows doesn't have the concept of executable files this sniff targets, so the test would always fail. --- src/Standards/Generic/Tests/Files/ExecutableFileUnitTest.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Standards/Generic/Tests/Files/ExecutableFileUnitTest.php b/src/Standards/Generic/Tests/Files/ExecutableFileUnitTest.php index 708634e973..f47fef6d36 100644 --- a/src/Standards/Generic/Tests/Files/ExecutableFileUnitTest.php +++ b/src/Standards/Generic/Tests/Files/ExecutableFileUnitTest.php @@ -24,7 +24,8 @@ protected function shouldSkipTest() { // PEAR doesn't preserve the executable flag, so skip // tests when running in a PEAR install. - return $GLOBALS['PHP_CODESNIFFER_PEAR']; + // Also skip on Windows which doesn't have the concept of executable files. + return ($GLOBALS['PHP_CODESNIFFER_PEAR'] || (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN')); }//end shouldSkipTest()