You are here

protected function feedsDrushTest::copyLocalFeedsDirToTestDir in Feeds 7.2

Copies the local Feeds directory to the directory used in the test.

1 call to feedsDrushTest::copyLocalFeedsDirToTestDir()
feedsDrushTest::setUp in tests/drush/feedsDrushTest.php

File

tests/drush/feedsDrushTest.php, line 49

Class

feedsDrushTest
Tests Drush integration for Feeds. Based on Drush 8.

Namespace

Unish

Code

protected function copyLocalFeedsDirToTestDir() {
  $source = dirname(dirname(dirname(__FILE__)));
  $dest = $this
    ->getFeedsDir();
  mkdir($dest, 0755, TRUE);
  foreach ($iterator = new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($source, \RecursiveDirectoryIterator::SKIP_DOTS), \RecursiveIteratorIterator::SELF_FIRST) as $item) {
    if ($item
      ->isDir()) {
      mkdir($dest . "/" . $iterator
        ->getSubPathName());
    }
    else {
      copy($item, $dest . "/" . $iterator
        ->getSubPathName());
    }
  }
}