class MigrateDrupalTestBase
Same name in this branch
- 9 core/modules/tracker/tests/src/Kernel/Migrate/d7/MigrateDrupalTestBase.php \Drupal\Tests\tracker\Kernel\Migrate\d7\MigrateDrupalTestBase
Same name and namespace in other branches
- 10 core/modules/migrate_drupal/tests/src/Kernel/MigrateDrupalTestBase.php \Drupal\Tests\migrate_drupal\Kernel\MigrateDrupalTestBase
- 11.x core/modules/migrate_drupal/tests/src/Kernel/MigrateDrupalTestBase.php \Drupal\Tests\migrate_drupal\Kernel\MigrateDrupalTestBase
- 10 core/modules/tracker/tests/src/Kernel/Migrate/d7/MigrateDrupalTestBase.php \Drupal\Tests\tracker\Kernel\Migrate\d7\MigrateDrupalTestBase
- 8.9.x core/modules/migrate_drupal/tests/src/Kernel/MigrateDrupalTestBase.php \Drupal\Tests\migrate_drupal\Kernel\MigrateDrupalTestBase
Base class for Drupal migration tests.
Hierarchy
- class \Drupal\KernelTests\KernelTestBase implements \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 extends \PHPUnit\Framework\TestCase
- class \Drupal\Tests\migrate\Kernel\MigrateTestBase implements \Drupal\migrate\MigrateMessageInterface extends \Drupal\KernelTests\KernelTestBase
- class \Drupal\Tests\migrate_drupal\Kernel\MigrateDrupalTestBase extends \Drupal\Tests\migrate\Kernel\MigrateTestBase
- class \Drupal\Tests\migrate\Kernel\MigrateTestBase implements \Drupal\migrate\MigrateMessageInterface extends \Drupal\KernelTests\KernelTestBase
Expanded class hierarchy of MigrateDrupalTestBase
19 files declare their use of MigrateDrupalTestBase
- DestinationCategoryTest.php in core/
modules/ migrate_drupal/ tests/ src/ Kernel/ Plugin/ migrate/ DestinationCategoryTest.php - FilterFormatPermissionTest.php in core/
modules/ filter/ tests/ src/ Kernel/ Migrate/ d6/ FilterFormatPermissionTest.php - MigrateAggregatorStubTest.php in core/
modules/ aggregator/ tests/ src/ Kernel/ Migrate/ MigrateAggregatorStubTest.php - MigrateBlockContentStubTest.php in core/
modules/ block_content/ tests/ src/ Kernel/ Migrate/ MigrateBlockContentStubTest.php - MigrateCommentStubTest.php in core/
modules/ comment/ tests/ src/ Kernel/ Migrate/ MigrateCommentStubTest.php
File
-
core/
modules/ migrate_drupal/ tests/ src/ Kernel/ MigrateDrupalTestBase.php, line 11
Namespace
Drupal\Tests\migrate_drupal\KernelView source
abstract class MigrateDrupalTestBase extends MigrateTestBase {
/**
* Modules to enable.
*
* @var array
*/
protected static $modules = [
'system',
'user',
'field',
'migrate_drupal',
'options',
'file',
];
/**
* {@inheritdoc}
*/
protected function setUp() {
parent::setUp();
$module_handler = \Drupal::moduleHandler();
if ($module_handler->moduleExists('node')) {
$this->installEntitySchema('node');
}
if ($module_handler->moduleExists('comment')) {
$this->installEntitySchema('comment');
}
if ($module_handler->moduleExists('taxonomy')) {
$this->installEntitySchema('taxonomy_term');
}
if ($module_handler->moduleExists('user')) {
$this->installEntitySchema('user');
}
$this->installConfig([
'migrate_drupal',
'system',
]);
}
/**
* Loads a database fixture into the source database connection.
*
* @param string $path
* Path to the dump file.
*/
protected function loadFixture($path) {
$default_db = Database::getConnection()->getKey();
Database::setActiveConnection($this->sourceDatabase
->getKey());
if (substr($path, -3) == '.gz') {
$path = 'compress.zlib://' . $path;
}
require $path;
Database::setActiveConnection($default_db);
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.