function FileCopyTest::testDownloadRemoteUri

Same name in other branches
  1. 9 core/modules/migrate/tests/src/Kernel/process/FileCopyTest.php \Drupal\Tests\migrate\Kernel\process\FileCopyTest::testDownloadRemoteUri()
  2. 8.9.x core/modules/migrate/tests/src/Kernel/process/FileCopyTest.php \Drupal\Tests\migrate\Kernel\process\FileCopyTest::testDownloadRemoteUri()
  3. 10 core/modules/migrate/tests/src/Kernel/process/FileCopyTest.php \Drupal\Tests\migrate\Kernel\process\FileCopyTest::testDownloadRemoteUri()

Tests that remote URIs are delegated to the download plugin.

File

core/modules/migrate/tests/src/Kernel/process/FileCopyTest.php, line 214

Class

FileCopyTest
Tests the file_copy process plugin.

Namespace

Drupal\Tests\migrate\Kernel\process

Code

public function testDownloadRemoteUri() : void {
    $download_plugin = $this->createMock(MigrateProcessInterface::class);
    $download_plugin->expects($this->once())
        ->method('transform');
    $plugin = new FileCopy([], $this->randomMachineName(), [], $this->container
        ->get('stream_wrapper_manager'), $this->container
        ->get('file_system'), $download_plugin);
    $plugin->transform([
        'http://drupal.org/favicon.ico',
        '/destination/path',
    ], $this->createMock(MigrateExecutableInterface::class), new Row([], []), $this->randomMachineName());
}

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