diff --git a/core/modules/block/tests/src/Kernel/Migrate/d7/MigrateBlockContentTranslationTest.php b/core/modules/block/tests/src/Kernel/Migrate/d7/MigrateBlockContentTranslationTest.php index 0d082a8e06..8f45beb22d 100644 --- a/core/modules/block/tests/src/Kernel/Migrate/d7/MigrateBlockContentTranslationTest.php +++ b/core/modules/block/tests/src/Kernel/Migrate/d7/MigrateBlockContentTranslationTest.php @@ -38,9 +38,9 @@ class MigrateBlockContentTranslationTest extends MigrateDrupal7TestBase { */ protected function setUp() { parent::setUp(); + $this->installEntitySchema('block_content'); $this->installConfig(['block']); $this->installConfig(['block_content']); - $this->installEntitySchema('block_content'); $this->executeMigrations([ 'language', diff --git a/core/modules/block_content/tests/src/Kernel/Migrate/d7/MigrateCustomBlockContentTranslationTest.php b/core/modules/block_content/tests/src/Kernel/Migrate/d7/MigrateCustomBlockContentTranslationTest.php index 092eb0a853..5f3b98b9c1 100644 --- a/core/modules/block_content/tests/src/Kernel/Migrate/d7/MigrateCustomBlockContentTranslationTest.php +++ b/core/modules/block_content/tests/src/Kernel/Migrate/d7/MigrateCustomBlockContentTranslationTest.php @@ -30,8 +30,8 @@ class MigrateCustomBlockContentTranslationTest extends MigrateDrupal7TestBase { */ protected function setUp() { parent::setUp(); - $this->installConfig(['block_content']); $this->installEntitySchema('block_content'); + $this->installConfig(['block_content']); $this->executeMigrations([ 'language', 'd7_filter_format', diff --git a/core/modules/migrate/tests/src/Kernel/Plugin/MigrationPluginListTest.php b/core/modules/migrate/tests/src/Kernel/Plugin/MigrationPluginListTest.php index b256e3f3a3..1a340e4e43 100644 --- a/core/modules/migrate/tests/src/Kernel/Plugin/MigrationPluginListTest.php +++ b/core/modules/migrate/tests/src/Kernel/Plugin/MigrationPluginListTest.php @@ -60,6 +60,15 @@ class MigrationPluginListTest extends KernelTestBase { 'user', ]; + /** + * {@inheritdoc} + */ + protected function setUp() { + parent::setUp(); + + $this->installEntitySchema('user'); + } + /** * @covers ::getDefinitions */ diff --git a/core/tests/Drupal/KernelTests/Core/Entity/EntityBundleFieldTest.php b/core/tests/Drupal/KernelTests/Core/Entity/EntityBundleFieldTest.php index 16c555d0e7..774db4b36b 100644 --- a/core/tests/Drupal/KernelTests/Core/Entity/EntityBundleFieldTest.php +++ b/core/tests/Drupal/KernelTests/Core/Entity/EntityBundleFieldTest.php @@ -14,7 +14,7 @@ class EntityBundleFieldTest extends EntityKernelTestBase { * * @var array */ - public static $modules = ['entity_schema_test']; + public static $modules = ['entity_schema_test', 'entity_test_update']; /** * The module handler. @@ -36,6 +36,7 @@ class EntityBundleFieldTest extends EntityKernelTestBase { protected function setUp() { parent::setUp(); $this->installSchema('user', ['users_data']); + $this->installEntitySchema('entity_test_update'); $this->moduleHandler = $this->container->get('module_handler'); $this->database = $this->container->get('database'); } @@ -44,13 +45,13 @@ protected function setUp() { * Tests making use of a custom bundle field. */ public function testCustomBundleFieldUsage() { - entity_test_create_bundle('custom'); + entity_test_create_bundle('custom', NULL, 'entity_test_update'); // Check that an entity with bundle entity_test does not have the custom // field. - $storage = $this->entityManager->getStorage('entity_test'); + $storage = $this->entityManager->getStorage('entity_test_update'); $entity = $storage->create([ - 'type' => 'entity_test', + 'type' => 'entity_test_update', ]); $this->assertFalse($entity->hasField('custom_bundle_field')); @@ -63,7 +64,7 @@ public function testCustomBundleFieldUsage() { // Ensure that the field exists in the field map. $field_map = \Drupal::entityManager()->getFieldMap(); - $this->assertEqual($field_map['entity_test']['custom_bundle_field'], ['type' => 'string', 'bundles' => ['custom' => 'custom']]); + $this->assertEqual($field_map['entity_test_update']['custom_bundle_field'], ['type' => 'string', 'bundles' => ['custom' => 'custom']]); $entity->custom_bundle_field->value = 'swanky'; $entity->save(); @@ -91,7 +92,7 @@ public function testCustomBundleFieldUsage() { // bundle is deleted. $entity = $storage->create(['type' => 'custom', 'custom_bundle_field' => 'new']); $entity->save(); - entity_test_delete_bundle('custom'); + entity_test_delete_bundle('custom', 'entity_test_update'); $table = $table_mapping->getDedicatedDataTableName($entity->getFieldDefinition('custom_bundle_field')->getFieldStorageDefinition(), TRUE); $result = $this->database->select($table, 'f') @@ -103,7 +104,7 @@ public function testCustomBundleFieldUsage() { // Ensure that the field no longer exists in the field map. $field_map = \Drupal::entityManager()->getFieldMap(); - $this->assertFalse(isset($field_map['entity_test']['custom_bundle_field'])); + $this->assertFalse(isset($field_map['entity_test_update']['custom_bundle_field'])); // Purge field data, and check that the storage definition has been // completely removed once the data is purged.