Updated Drupal to 8.6. This goes with the following updates because it's possible...
[yaffs-website] / vendor / symfony / filesystem / Tests / LockHandlerTest.php
index e0b2281e0552a22918733f324a7597ba47418469..14eabc021edb5f055b93b61b9ead9d126c7f6b14 100644 (file)
@@ -48,10 +48,14 @@ 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.');
         }
 
+        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;
@@ -79,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));
     }