| 7 file.test | FileTestCase::createDirectory($path = NULL) |
| 8 file.test | FileTestCase::createDirectory($path = NULL) |
Create a directory and assert it exists.
Parameters
$path: Optional string with a directory path. If none is provided, a random name in the site's files directory will be used.
Return value
The path to the directory.
File
- modules/
simpletest/ tests/ file.test, line 174 - This provides SimpleTests for the core file handling functionality. These include FileValidateTest and FileSaveTest.
Code
function createDirectory($path = NULL) {
// A directory to operate on.
if (!isset($path)) {
$path = file_default_scheme() . '://' . $this->randomName();
}
$this->assertTrue(drupal_mkdir($path) && is_dir($path), t('Directory was created successfully.'));
return $path;
}
Login or register to post comments