function FileTransferTest::_buildFakeModule

Same name in other branches
  1. 9 core/modules/system/tests/src/Functional/FileTransfer/FileTransferTest.php \Drupal\Tests\system\Functional\FileTransfer\FileTransferTest::_buildFakeModule()
  2. 10 core/modules/system/tests/src/Functional/FileTransfer/FileTransferTest.php \Drupal\Tests\system\Functional\FileTransfer\FileTransferTest::_buildFakeModule()
  3. 11.x core/modules/system/tests/src/Functional/FileTransfer/FileTransferTest.php \Drupal\Tests\system\Functional\FileTransfer\FileTransferTest::_buildFakeModule()
1 call to FileTransferTest::_buildFakeModule()
FileTransferTest::testJail in core/modules/system/tests/src/Functional/FileTransfer/FileTransferTest.php

File

core/modules/system/tests/src/Functional/FileTransfer/FileTransferTest.php, line 45

Class

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

Namespace

Drupal\Tests\system\Functional\FileTransfer

Code

public function _buildFakeModule() {
    $location = 'temporary://fake';
    if (is_dir($location)) {
        $ret = 0;
        $output = [];
        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;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.