You are here

function FileTransferTest::_writeDirectory 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::_writeDirectory()
1 call to FileTransferTest::_writeDirectory()
FileTransferTest::_buildFakeModule in core/modules/system/src/Tests/FileTransfer/FileTransferTest.php

File

core/modules/system/src/Tests/FileTransfer/FileTransferTest.php, line 61
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 _writeDirectory($base, $files = array()) {
  mkdir($base);
  foreach ($files as $key => $file) {
    if (is_array($file)) {
      $this
        ->_writeDirectory($base . DIRECTORY_SEPARATOR . $key, $file);
    }
    else {

      //just write the filename into the file
      file_put_contents($base . DIRECTORY_SEPARATOR . $file, $file);
    }
  }
}