You are here

function FileTransferTest::_buildFakeModule in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/system/src/Tests/FileTransfer/FileTransferTest.php \Drupal\system\Tests\FileTransfer\FileTransferTest::_buildFakeModule()
1 call to FileTransferTest::_buildFakeModule()
FileTransferTest::testJail in core/modules/system/src/Tests/FileTransfer/FileTransferTest.php

File

core/modules/system/src/Tests/FileTransfer/FileTransferTest.php, line 45
Contains \Drupal\system\Tests\FileTransfer\FileTransferTest.

Class

FileTransferTest
Tests that the jail is respected and that protocols using recursive file move operations work.

Namespace

Drupal\system\Tests\FileTransfer

Code

function _buildFakeModule() {
  $location = 'temporary://fake';
  if (is_dir($location)) {
    $ret = 0;
    $output = array();
    exec('rm -Rf ' . escapeshellarg($location), $output, $ret);
    if ($ret != 0) {
      throw new Exception('Error removing fake module directory.');
    }
  }
  $files = $this
    ->_getFakeModuleFiles();
  $this
    ->_writeDirectory($location, $files);
  return $location;
}