You are here

public function FileCopyTest::testDownloadRemoteUri in Drupal 8

Same name and namespace in other branches
  1. 9 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 212

Class

FileCopyTest
Tests the file_copy process plugin.

Namespace

Drupal\Tests\migrate\Kernel\process

Code

public function testDownloadRemoteUri() {
  $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());
}