function FileTransferTest::_buildFakeModule

1 call to FileTransferTest::_buildFakeModule()
FileTransferTest::testJail in drupal/core/modules/system/lib/Drupal/system/Tests/FileTransfer/FileTransferTest.php

File

drupal/core/modules/system/lib/Drupal/system/Tests/FileTransfer/FileTransferTest.php, line 49
Definition of Drupal\system\Tests\FileTransfer\FileTransferTest.

Class

FileTransferTest
File transfer tests.

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;
}