Updated to Drupal 8.5. Core Media not yet in use.
[yaffs-website] / web / core / tests / Drupal / Tests / Component / PhpStorage / FileStorageTest.php
index 52e1b83c032ed21c5add56482ad1d07635ba1eab..168d1603e3ceb2bdcc9ec9311d11dbb3adceef8a 100644 (file)
@@ -5,7 +5,7 @@ namespace Drupal\Tests\Component\PhpStorage;
 use Drupal\Component\PhpStorage\FileStorage;
 use Drupal\Component\Utility\Random;
 use org\bovigo\vfs\vfsStreamDirectory;
-use PHPUnit_Framework_Error_Warning;
+use PHPUnit\Framework\Error\Warning;
 
 /**
  * @coversDefaultClass \Drupal\Component\PhpStorage\FileStorage
@@ -99,7 +99,13 @@ class FileStorageTest extends PhpStorageTestBase {
       'bin' => 'test',
     ]);
     $code = "<?php\n echo 'here';";
-    $this->setExpectedException(PHPUnit_Framework_Error_Warning::class, 'mkdir(): Permission Denied');
+    if (method_exists($this, 'expectException')) {
+      $this->expectException(Warning::class);
+      $this->expectExceptionMessage('mkdir(): Permission Denied');
+    }
+    else {
+      $this->setExpectedException(\PHPUnit_Framework_Error_Warning::class, 'mkdir(): Permission Denied');
+    }
     $storage->save('subdirectory/foo.php', $code);
   }