X-Git-Url: https://yaffs.net/gitweb/?a=blobdiff_plain;f=vendor%2Fsymfony%2Ffilesystem%2FTests%2FLockHandlerTest.php;h=14eabc021edb5f055b93b61b9ead9d126c7f6b14;hb=4e1bfbf98b844da83b18aca92ef00f11a4735806;hp=0791cebc694b84d7172fe30c45f3de87a75b9877;hpb=eba34333e3c89f208d2f72fa91351ad019a71583;p=yaffs-website diff --git a/vendor/symfony/filesystem/Tests/LockHandlerTest.php b/vendor/symfony/filesystem/Tests/LockHandlerTest.php index 0791cebc6..14eabc021 100644 --- a/vendor/symfony/filesystem/Tests/LockHandlerTest.php +++ b/vendor/symfony/filesystem/Tests/LockHandlerTest.php @@ -16,6 +16,9 @@ use Symfony\Component\Filesystem\Exception\IOException; use Symfony\Component\Filesystem\Filesystem; use Symfony\Component\Filesystem\LockHandler; +/** + * @group legacy + */ class LockHandlerTest extends TestCase { /** @@ -45,11 +48,15 @@ class LockHandlerTest extends TestCase public function testErrorHandlingInLockIfLockPathBecomesUnwritable() { // skip test on Windows; PHP can't easily set file as unreadable on Windows - if ('\\' === DIRECTORY_SEPARATOR) { + if ('\\' === \DIRECTORY_SEPARATOR) { $this->markTestSkipped('This test cannot run on Windows.'); } - $lockPath = sys_get_temp_dir().'/'.uniqid(); + if (!getenv('USER') || 'root' === getenv('USER')) { + $this->markTestSkipped('This test will fail if run under superuser'); + } + + $lockPath = sys_get_temp_dir().'/'.uniqid('', true); $e = null; $wrongMessage = null; @@ -76,7 +83,7 @@ class LockHandlerTest extends TestCase $fs->remove($lockPath); } - $this->assertInstanceOf('Symfony\Component\Filesystem\Exception\IOException', $e, sprintf('Expected IOException to be thrown, got %s instead.', get_class($e))); + $this->assertInstanceOf('Symfony\Component\Filesystem\Exception\IOException', $e, sprintf('Expected IOException to be thrown, got %s instead.', \get_class($e))); $this->assertNull($wrongMessage, sprintf('Expected exception message to contain "Permission denied", got "%s" instead.', $wrongMessage)); }