function FileStorageTest::testCreateDirectoryFailWarning
@covers ::createDirectory
      
    
File
- 
              core/tests/ Drupal/ Tests/ Component/ PhpStorage/ FileStorageTest.php, line 95 
Class
- FileStorageTest
- @coversDefaultClass \Drupal\Component\PhpStorage\FileStorage[[api-linebreak]] @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->expectException(Warning::class);
  $this->expectExceptionMessage('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.
