function DownloadTest::testOverwritingDownload
Same name in other branches
- 9 core/modules/migrate/tests/src/Kernel/process/DownloadTest.php \Drupal\Tests\migrate\Kernel\process\DownloadTest::testOverwritingDownload()
- 10 core/modules/migrate/tests/src/Kernel/process/DownloadTest.php \Drupal\Tests\migrate\Kernel\process\DownloadTest::testOverwritingDownload()
- 11.x 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\processCode
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->assertFileNotExists('public://existing_file_0.txt');
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.