protected function FileCopyTest::doTransform in Drupal 10
Same name and namespace in other branches
- 8 core/modules/migrate/tests/src/Kernel/process/FileCopyTest.php \Drupal\Tests\migrate\Kernel\process\FileCopyTest::doTransform()
- 9 core/modules/migrate/tests/src/Kernel/process/FileCopyTest.php \Drupal\Tests\migrate\Kernel\process\FileCopyTest::doTransform()
Do an import using the destination.
Parameters
string $source_path: Source path to copy from.
string $destination_path: The destination path to copy to.
array $configuration: Process plugin configuration settings.
Return value
string The URI of the copied file.
6 calls to FileCopyTest::doTransform()
- FileCopyTest::testNonExistentSourceFile in core/
modules/ migrate/ tests/ src/ Kernel/ process/ FileCopyTest.php - Tests that non-existent files throw an exception.
- FileCopyTest::testNonWritableDestination in core/
modules/ migrate/ tests/ src/ Kernel/ process/ FileCopyTest.php - Tests that non-writable destination throw an exception.
- FileCopyTest::testRenameFile in core/
modules/ migrate/ tests/ src/ Kernel/ process/ FileCopyTest.php - Tests the 'rename' overwrite mode.
- FileCopyTest::testSuccessfulCopies in core/
modules/ migrate/ tests/ src/ Kernel/ process/ FileCopyTest.php - Tests successful imports/copies.
- FileCopyTest::testSuccessfulMoves in core/
modules/ migrate/ tests/ src/ Kernel/ process/ FileCopyTest.php - Tests successful moves.
File
- core/
modules/ migrate/ tests/ src/ Kernel/ process/ FileCopyTest.php, line 246
Class
- FileCopyTest
- Tests the file_copy process plugin.
Namespace
Drupal\Tests\migrate\Kernel\processCode
protected function doTransform($source_path, $destination_path, $configuration = []) {
// Prepare a mock HTTP client.
$this->container
->set('http_client', $this
->createMock(Client::class));
$plugin = FileCopy::create($this->container, $configuration, 'file_copy', []);
$executable = $this
->prophesize(MigrateExecutableInterface::class)
->reveal();
$row = new Row([], []);
return $plugin
->transform([
$source_path,
$destination_path,
], $executable, $row, 'foo');
}