function FileTranferTest::_writeDirectory

7.x filetransfer.test FileTranferTest::_writeDirectory($base, $files = array())
1 call to FileTranferTest::_writeDirectory()
FileTranferTest::_buildFakeModule in drupal-7.x/modules/simpletest/tests/filetransfer.test

File

drupal-7.x/modules/simpletest/tests/filetransfer.test, line 53

Class

FileTranferTest

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