Create a directory and assert it exists.
$path: Optional string with a directory path. If none is provided, a random name in the site's files directory will be used.
The path to the directory.
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), 'Directory was created successfully.');
return $path;
}