FileMigrationTestTrait.php in Drupal 8
File
core/modules/file/tests/src/Kernel/Migrate/d6/FileMigrationTestTrait.php
View source
<?php
namespace Drupal\Tests\file\Kernel\Migrate\d6;
use Drupal\migrate\Plugin\MigrationInterface;
trait FileMigrationTestTrait {
protected function setUpMigratedFiles() {
$this
->installEntitySchema('file');
$this
->installConfig([
'file',
]);
$this
->executeMigration('d6_file');
}
protected function prepareMigration(MigrationInterface $migration) {
$destination = $migration
->getDestinationConfiguration();
if ($destination['plugin'] === 'entity:file') {
$source = $migration
->getSourceConfiguration();
$source['site_path'] = 'core/modules/simpletest';
$source['constants']['source_base_path'] = $this->root . '/';
$migration
->set('source', $source);
}
}
}