function FileTransferTest::_buildFakeModule
Builds a fake module directory for testing.
1 call to FileTransferTest::_buildFakeModule()
- FileTransferTest::testJail in core/
modules/ system/ tests/ src/ Functional/ FileTransfer/ FileTransferTest.php - Tests the file transfer jail.
File
-
core/
modules/ system/ tests/ src/ Functional/ FileTransfer/ FileTransferTest.php, line 60
Class
- FileTransferTest
- Tests recursive file copy operations with the file transfer jail.
Namespace
Drupal\Tests\system\Functional\FileTransferCode
public function _buildFakeModule() {
$location = 'temporary://fake';
if (is_dir($location)) {
if (!\Drupal::service('file_system')->deleteRecursive($location)) {
throw new \Exception('Error removing fake module directory.');
}
}
$files = $this->_getFakeModuleFiles();
$this->_writeDirectory($location, $files);
return $location;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.