class MigrateDrupalTestBase
Same name in this branch
- 9 core/modules/migrate_drupal/tests/src/Kernel/MigrateDrupalTestBase.php \Drupal\Tests\migrate_drupal\Kernel\MigrateDrupalTestBase
Same name and namespace in other branches
- 11.x core/modules/migrate_drupal/tests/src/Kernel/MigrateDrupalTestBase.php \Drupal\Tests\migrate_drupal\Kernel\MigrateDrupalTestBase
Base class for Tracker Drupal 7 migration tests.
Hierarchy
- class \Drupal\KernelTests\KernelTestBase extends \Drupal\Core\DependencyInjection\ServiceProviderInterface uses \Drupal\KernelTests\AssertLegacyTrait, \Drupal\KernelTests\AssertContentTrait, \Drupal\Tests\RandomGeneratorTrait, \Drupal\Tests\ConfigTestTrait, \Drupal\Tests\ExtensionListTestTrait, \Drupal\Tests\TestRequirementsTrait, \Drupal\Tests\Traits\PhpUnitWarnings, \Drupal\Tests\PhpUnitCompatibilityTrait, \Symfony\Bridge\PhpUnit\ExpectDeprecationTrait implements \PHPUnit\Framework\TestCase
- class \Drupal\Tests\migrate\Kernel\MigrateTestBase extends \Drupal\migrate\MigrateMessageInterface implements \Drupal\KernelTests\KernelTestBase
- class \Drupal\Tests\migrate_drupal\Kernel\MigrateDrupalTestBase implements \Drupal\Tests\migrate\Kernel\MigrateTestBase
- class \Drupal\Tests\tracker\Kernel\Migrate\d7\MigrateDrupalTestBase uses \Drupal\Tests\migrate_drupal\Traits\NodeMigrateTypeTestTrait implements \Drupal\Tests\migrate_drupal\Kernel\MigrateDrupalTestBase
- class \Drupal\Tests\migrate_drupal\Kernel\MigrateDrupalTestBase implements \Drupal\Tests\migrate\Kernel\MigrateTestBase
- class \Drupal\Tests\migrate\Kernel\MigrateTestBase extends \Drupal\migrate\MigrateMessageInterface implements \Drupal\KernelTests\KernelTestBase
Expanded class hierarchy of MigrateDrupalTestBase
File
-
core/
modules/ tracker/ tests/ src/ Kernel/ Migrate/ d7/ MigrateDrupalTestBase.php, line 12
Namespace
Drupal\Tests\tracker\Kernel\Migrate\d7View source
abstract class MigrateDrupalTestBase extends CoreMigrateDrupalTestBase {
use NodeMigrateTypeTestTrait;
/**
* {@inheritdoc}
*/
protected function setUp() : void {
parent::setUp();
// Add a node classic migrate table to the destination site so that tests
// run by default with the classic node migrations.
$this->makeNodeMigrateMapTable(NodeMigrateType::NODE_MIGRATE_TYPE_CLASSIC, '7');
$this->loadFixture($this->getFixtureFilePath());
}
/**
* Gets the path to the fixture file.
*/
protected function getFixtureFilePath() {
return __DIR__ . '/../../../../fixtures/drupal7.php';
}
/**
* Executes all user migrations.
*
* @param bool $include_pictures
* (optional) If TRUE, migrates user pictures. Defaults to TRUE.
*/
protected function migrateUsers($include_pictures = TRUE) {
$migrations = [
'd7_user_role',
'd7_user',
];
if ($include_pictures) {
// Prepare to migrate user pictures as well.
$this->installEntitySchema('file');
$migrations = array_merge([
'user_picture_field',
'user_picture_field_instance',
], $migrations);
}
$this->executeMigrations($migrations);
}
/**
* Migrates node types.
*/
protected function migrateContentTypes() {
$this->installConfig([
'node',
]);
$this->installEntitySchema('node');
$this->executeMigration('d7_node_type');
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.