function FileStorageTest::testCreateDirectoryFailWarning
Same name in other branches
- 8.9.x core/tests/Drupal/Tests/Component/PhpStorage/FileStorageTest.php \Drupal\Tests\Component\PhpStorage\FileStorageTest::testCreateDirectoryFailWarning()
- 10 core/tests/Drupal/Tests/Component/PhpStorage/FileStorageTest.php \Drupal\Tests\Component\PhpStorage\FileStorageTest::testCreateDirectoryFailWarning()
- 11.x core/tests/Drupal/Tests/Component/PhpStorage/FileStorageTest.php \Drupal\Tests\Component\PhpStorage\FileStorageTest::testCreateDirectoryFailWarning()
@covers ::createDirectory
File
-
core/
tests/ Drupal/ Tests/ Component/ PhpStorage/ FileStorageTest.php, line 97
Class
- FileStorageTest
- @coversDefaultClass \Drupal\Component\PhpStorage\FileStorage @group Drupal @group PhpStorage
Namespace
Drupal\Tests\Component\PhpStorageCode
public function testCreateDirectoryFailWarning() {
$directory = new vfsStreamDirectory('permissionDenied', 0200);
$storage = new FileStorage([
'directory' => $directory->url(),
'bin' => 'test',
]);
$code = "<?php\n echo 'here';";
$this->expectWarning();
$this->expectWarningMessage('mkdir(): Permission Denied');
$storage->save('subdirectory/foo.php', $code);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.