Fix: Skip UtilsTest on windows where ls is not available (#28601)

# Fix: Skip UtilsTest on windows where ls is not available

The test in question uses 'ls' which is not available on windows.
This change limits the execution to non windows systems.
This commit is contained in:
MDW
2024-03-03 17:01:17 +01:00
committed by GitHub
parent 3663b9b305
commit faf00c35e3
2 changed files with 23 additions and 0 deletions

View File

@@ -418,4 +418,22 @@ abstract class CommonClassTest extends TestCase
$this->assertFileDoesNotExist($file, $message);
}
}
/**
* Skip test if test is not running on "Unix"
*
* @param string $message Message to indicate which test requires "Unix"
*
* @return bool True if this is not *nix, and fake assert generated
*/
protected function fakeAssertIfNotUnix($message)
{
if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
$this->assertTrue(true, "Dummy test to not mark the test as risky");
// $this->markTestSkipped("PHPUNIT is running on windows. $message");
return true;
}
return false;
}
}