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
'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);
}