mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2026-02-10 01:42:33 +01:00
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:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user