File
- drupal/core/modules/system/lib/Drupal/system/Tests/FileTransfer/FileTransferTest.php, line 78
- Definition of Drupal\system\Tests\FileTransfer\FileTransferTest.
Class
- FileTransferTest
- File transfer tests.
Namespace
Drupal\system\Tests\FileTransfer
Code
function testJail() {
$source = $this
->_buildFakeModule();
$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.');
$gotit = TRUE;
try {
$this->testConnection
->copyDirectory($source, DRUPAL_ROOT . '/' . variable_get('file_public_path', conf_path() . '/files'));
} catch (FileTransferException $e) {
$gotit = FALSE;
}
$this
->assertTrue($gotit, 'Was able to copy a directory inside of the jailed area');
}