You are here

public function FeedsWebTestBase::copyDir in Feeds 8.2

Copies a directory.

3 calls to FeedsWebTestBase::copyDir()
FeedsFileFetcherTest::testPrivateFiles in lib/Drupal/feeds/Tests/FeedsFileFetcherTest.php
Test uploading private files.
FeedsFileFetcherTest::testPublicFiles in lib/Drupal/feeds/Tests/FeedsFileFetcherTest.php
Test scheduling on cron.
FeedsMapperFileTest::test in lib/Drupal/feeds/Tests/FeedsMapperFileTest.php
Basic test loading a single entry CSV file.

File

lib/Drupal/feeds/Tests/FeedsWebTestBase.php, line 542
Common functionality for all Feeds tests.

Class

FeedsWebTestBase
Test basic Data API functionality.

Namespace

Drupal\feeds\Tests

Code

public function copyDir($source, $dest) {
  $result = file_prepare_directory($dest, FILE_CREATE_DIRECTORY | FILE_MODIFY_PERMISSIONS);
  foreach (@scandir($source) as $file) {
    if (is_file("{$source}/{$file}")) {
      $file = file_unmanaged_copy("{$source}/{$file}", "{$dest}/{$file}");
    }
  }
}