function FileMigrationTestTrait::prepareMigration
Same name in other branches
- 9 core/modules/file/tests/src/Kernel/Migrate/d6/FileMigrationTestTrait.php \Drupal\Tests\file\Kernel\Migrate\d6\FileMigrationTestTrait::prepareMigration()
- 10 core/modules/file/tests/src/Kernel/Migrate/d6/FileMigrationTestTrait.php \Drupal\Tests\file\Kernel\Migrate\d6\FileMigrationTestTrait::prepareMigration()
- 11.x core/modules/file/tests/src/Kernel/Migrate/d6/FileMigrationTestTrait.php \Drupal\Tests\file\Kernel\Migrate\d6\FileMigrationTestTrait::prepareMigration()
File
-
core/
modules/ file/ tests/ src/ Kernel/ Migrate/ d6/ FileMigrationTestTrait.php, line 25
Class
- FileMigrationTestTrait
- Helper for setting up a file migration test.
Namespace
Drupal\Tests\file\Kernel\Migrate\d6Code
protected function prepareMigration(MigrationInterface $migration) {
// File migrations need a source_base_path.
// @see MigrateUpgradeRunBatch::run
$destination = $migration->getDestinationConfiguration();
if ($destination['plugin'] === 'entity:file') {
// Make sure we have a single trailing slash.
$source = $migration->getSourceConfiguration();
$source['site_path'] = 'core/modules/simpletest';
$source['constants']['source_base_path'] = $this->root . '/';
$migration->set('source', $source);
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.