diff --git a/core/modules/migrate_drupal/tests/src/Kernel/CreateContentTrait.php b/core/modules/migrate_drupal/tests/src/Kernel/MigrateDrupalCreateTestContentTrait.php similarity index 76% rename from core/modules/migrate_drupal/tests/src/Kernel/CreateContentTrait.php rename to core/modules/migrate_drupal/tests/src/Kernel/MigrateDrupalCreateTestContentTrait.php index 9cf22c6723..cb33c00c76 100644 --- a/core/modules/migrate_drupal/tests/src/Kernel/CreateContentTrait.php +++ b/core/modules/migrate_drupal/tests/src/Kernel/MigrateDrupalCreateTestContentTrait.php @@ -13,9 +13,24 @@ use Drupal\user\Entity\User; /** - * Provides helper methods for creating content. + * Provides helper methods for creating test content. */ -trait CreateContentTrait { +trait MigrateDrupalCreateTestContentTrait { + + /** + * Install required entity schemas. + */ + protected function installEntitySchemas() { + $this->installEntitySchema('aggregator_feed'); + $this->installEntitySchema('aggregator_item'); + $this->installEntitySchema('block_content'); + $this->installEntitySchema('comment'); + $this->installEntitySchema('file'); + $this->installEntitySchema('menu_link_content'); + $this->installEntitySchema('node'); + $this->installEntitySchema('taxonomy_term'); + $this->installEntitySchema('user'); + } /** * Create several pieces of generic content. diff --git a/core/modules/migrate_drupal/tests/src/Kernel/d6/MigrateDrupal6AuditIdsTest.php b/core/modules/migrate_drupal/tests/src/Kernel/d6/MigrateDrupal6AuditIdsTest.php index afb94aed97..65fc0535d8 100644 --- a/core/modules/migrate_drupal/tests/src/Kernel/d6/MigrateDrupal6AuditIdsTest.php +++ b/core/modules/migrate_drupal/tests/src/Kernel/d6/MigrateDrupal6AuditIdsTest.php @@ -6,7 +6,7 @@ use Drupal\migrate\Audit\AuditResult; use Drupal\migrate\Audit\IdAuditor; use Drupal\node\Entity\Node; -use Drupal\Tests\migrate_drupal\Kernel\CreateContentTrait; +use Drupal\Tests\migrate_drupal\Kernel\MigrateDrupalCreateTestContentTrait; /** * Tests the migration auditor for ID conflicts. @@ -16,7 +16,7 @@ class MigrateDrupal6AuditIdsTest extends MigrateDrupal6TestBase { use FileSystemModuleDiscoveryDataProviderTrait; - use CreateContentTrait; + use MigrateDrupalCreateTestContentTrait; /** * {@inheritdoc} @@ -26,20 +26,14 @@ protected function setUp() { self::$modules = array_keys($this->coreModuleListDataProvider()); parent::setUp(); + // Install required entity schemas. + $this->installEntitySchemas(); + // Install required schemas. - $this->installEntitySchema('aggregator_item'); - $this->installEntitySchema('aggregator_feed'); - $this->installEntitySchema('block_content'); - $this->installEntitySchema('comment'); - $this->installEntitySchema('file'); - $this->installEntitySchema('menu_link_content'); - $this->installEntitySchema('node'); - $this->installEntitySchema('taxonomy_term'); $this->installSchema('book', ['book']); $this->installSchema('dblog', ['watchdog']); $this->installSchema('forum', ['forum_index']); $this->installSchema('search', ['search_dataset']); - $this->installSchema('system', ['sequences']); $this->installSchema('tracker', ['tracker_node', 'tracker_user']); } diff --git a/core/modules/migrate_drupal/tests/src/Kernel/d7/MigrateDrupal7AuditIdsTest.php b/core/modules/migrate_drupal/tests/src/Kernel/d7/MigrateDrupal7AuditIdsTest.php index 39b59aa9ad..28ef9a8f0f 100644 --- a/core/modules/migrate_drupal/tests/src/Kernel/d7/MigrateDrupal7AuditIdsTest.php +++ b/core/modules/migrate_drupal/tests/src/Kernel/d7/MigrateDrupal7AuditIdsTest.php @@ -6,7 +6,7 @@ use Drupal\migrate\Audit\AuditResult; use Drupal\migrate\Audit\IdAuditor; use Drupal\node\Entity\Node; -use Drupal\Tests\migrate_drupal\Kernel\CreateContentTrait; +use Drupal\Tests\migrate_drupal\Kernel\MigrateDrupalCreateTestContentTrait; /** * Tests the migration auditor for ID conflicts. @@ -16,7 +16,7 @@ class MigrateDrupal7AuditIdsTest extends MigrateDrupal7TestBase { use FileSystemModuleDiscoveryDataProviderTrait; - use CreateContentTrait; + use MigrateDrupalCreateTestContentTrait; /** * {@inheritdoc} @@ -26,20 +26,14 @@ protected function setUp() { self::$modules = array_keys($this->coreModuleListDataProvider()); parent::setUp(); + // Install required entity schemas. + $this->installEntitySchemas(); + // Install required schemas. - $this->installEntitySchema('aggregator_item'); - $this->installEntitySchema('aggregator_feed'); - $this->installEntitySchema('block_content'); - $this->installEntitySchema('comment'); - $this->installEntitySchema('file'); - $this->installEntitySchema('menu_link_content'); - $this->installEntitySchema('node'); - $this->installEntitySchema('taxonomy_term'); $this->installSchema('book', ['book']); $this->installSchema('dblog', ['watchdog']); $this->installSchema('forum', ['forum_index']); $this->installSchema('search', ['search_dataset']); - $this->installSchema('system', ['sequences']); $this->installSchema('tracker', ['tracker_node', 'tracker_user']); } diff --git a/core/modules/migrate_drupal_ui/tests/src/Functional/MigrateUpgradeTestBase.php b/core/modules/migrate_drupal_ui/tests/src/Functional/MigrateUpgradeTestBase.php index 21816ba53a..9ad7a38a89 100644 --- a/core/modules/migrate_drupal_ui/tests/src/Functional/MigrateUpgradeTestBase.php +++ b/core/modules/migrate_drupal_ui/tests/src/Functional/MigrateUpgradeTestBase.php @@ -6,14 +6,15 @@ use Drupal\migrate\Plugin\MigrateIdMapInterface; use Drupal\migrate_drupal\MigrationConfigurationTrait; use Drupal\Tests\BrowserTestBase; -use Drupal\Tests\migrate_drupal\Kernel\CreateContentTrait; +use Drupal\Tests\migrate_drupal\Kernel\MigrateDrupalCreateTestContentTrait; /** * Provides a base class for testing migration upgrades in the UI. */ abstract class MigrateUpgradeTestBase extends BrowserTestBase { + use MigrationConfigurationTrait; - use CreateContentTrait; + use MigrateDrupalCreateTestContentTrait; /** * Use the Standard profile to test help implementations of many core modules.