You are here

protected function EntityFileTest::doImport in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/file/src/Tests/Migrate/EntityFileTest.php \Drupal\file\Tests\Migrate\EntityFileTest::doImport()

Do an import using the destination.

Parameters

array $row_values: An array of row values.

string $destination_path: The destination path to copy to.

string $source_base_path: The source base path.

Return value

array An array of saved entities ids.

Throws

\Drupal\migrate\MigrateException

2 calls to EntityFileTest::doImport()
EntityFileTest::testNonExistentSourceFile in core/modules/file/src/Tests/Migrate/EntityFileTest.php
Test that non-existent files throw an exception.
EntityFileTest::testSuccessfulCopies in core/modules/file/src/Tests/Migrate/EntityFileTest.php
Test successful imports/copies.

File

core/modules/file/src/Tests/Migrate/EntityFileTest.php, line 227
Contains \Drupal\file\Tests\Migrate\EntityFileTest.

Class

EntityFileTest
Tests the entity file destination plugin.

Namespace

Drupal\file\Tests\Migrate

Code

protected function doImport($row_values, $destination_path, $source_base_path = '') {
  $row = new Row($row_values, []);
  $row
    ->setDestinationProperty('uri', $destination_path);
  $this->destination->configuration['source_base_path'] = $source_base_path;

  // Importing asserts there are no errors, then we just check the file has
  // been copied into place.
  return $this->destination
    ->import($row, array());
}