Skip to content

Commit

Permalink
Generic/ExecutableFile: skip tests on Windows
Browse files Browse the repository at this point in the history
Windows doesn't have the concept of executable files this sniff targets, so the test would always fail.
  • Loading branch information
jrfnl committed Jan 2, 2020
1 parent 90b719d commit 9df8ae1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Standards/Generic/Tests/Files/ExecutableFileUnitTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down

0 comments on commit 9df8ae1

Please sign in to comment.