public function DirectoryTest::testDirectoryCreation in Drupal 9
Same name and namespace in other branches
- 8 core/tests/Drupal/KernelTests/Core/File/DirectoryTest.php \Drupal\KernelTests\Core\File\DirectoryTest::testDirectoryCreation()
Tests directory creation.
File
- core/
tests/ Drupal/ KernelTests/ Core/ File/ DirectoryTest.php, line 190
Class
- DirectoryTest
- Tests operations dealing with directories.
Namespace
Drupal\KernelTests\Core\FileCode
public function testDirectoryCreation() {
/** @var \Drupal\Core\File\FileSystemInterface $file_system */
$file_system = $this->container
->get('file_system');
// mkdir() recursion should work with or without a trailing slash.
$dir = $this->siteDirectory . '/files';
$this
->assertTrue($file_system
->mkdir($dir . '/foo/bar', 0775, TRUE));
$this
->assertTrue($file_system
->mkdir($dir . '/foo/baz/', 0775, TRUE));
}