$this->
assertTrue($file_system->
mkdir($absolute_path, 0775, TRUE
), 'No error reported when creating new absolute directories.'
);
$this->
assertDirectoryPermissions($absolute_path, 0775
);
} /**
* Tests directory handling functions.
*/
public function testFileCheckDirectoryHandling() { // A directory to operate on.
$default_scheme = 'public';
$directory =
$default_scheme . '://' .
$this->
randomMachineName() . '/' .
$this->
randomMachineName();
$this->
assertDirectoryDoesNotExist($directory);
// Non-existent directory.
/** @var \Drupal\Core\File\FileSystemInterface $file_system */
$file_system = \Drupal::
service('file_system'
);
$this->
assertFalse($file_system->
prepareDirectory($directory, 0
), 'Error reported for non-existing directory.'
);
// Make a directory.
$this->
assertTrue($file_system->
prepareDirectory($directory, FileSystemInterface::CREATE_DIRECTORY
), 'No error reported when creating a new directory.'
);
// Make sure directory actually exists.
$this->
assertDirectoryExists($directory);