You are here

public function DownloadTest::testOverwritingDownload in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/migrate/tests/src/Kernel/process/DownloadTest.php \Drupal\Tests\migrate\Kernel\process\DownloadTest::testOverwritingDownload()

Tests a download that overwrites an existing local file.

File

core/modules/migrate/tests/src/Kernel/process/DownloadTest.php, line 36

Class

DownloadTest
Tests the download process plugin.

Namespace

Drupal\Tests\migrate\Kernel\process

Code

public function testOverwritingDownload() {

  // Create a pre-existing file at the destination, to test overwrite behavior.
  $destination_uri = $this
    ->createUri('existing_file.txt');

  // Test destructive download.
  $actual_destination = $this
    ->doTransform($destination_uri);
  $this
    ->assertSame($destination_uri, $actual_destination, 'Import returned a destination that was not renamed');
  $this
    ->assertFileDoesNotExist('public://existing_file_0.txt');
}