if (is_array($file)) { $this->
_writeDirectory($base . DIRECTORY_SEPARATOR .
$key,
$file);
} else { // just write the filename into the file
file_put_contents($base . DIRECTORY_SEPARATOR .
$file,
$file);
} } } public function testJail() { $source =
$this->
_buildFakeModule();
// This convoluted piece of code is here because our testing framework does
// not support expecting exceptions.
$gotit = FALSE;
try { $this->testConnection->
copyDirectory($source,
sys_get_temp_dir());
} catch (FileTransferException
$e) { $gotit = TRUE;
} $this->
assertTrue($gotit, 'Was not able to copy a directory outside of the jailed area.'
);