diff --git a/core/modules/content_moderation/tests/src/Kernel/ContentModerationStateTest.php b/core/modules/content_moderation/tests/src/Kernel/ContentModerationStateTest.php index 72591e1..bcb499e 100644 --- a/core/modules/content_moderation/tests/src/Kernel/ContentModerationStateTest.php +++ b/core/modules/content_moderation/tests/src/Kernel/ContentModerationStateTest.php @@ -234,11 +234,10 @@ public function testEntityTestModeration() { $entity_test_rev->save(); $this->assertEquals('draft', $entity_test_rev->moderation_state->entity->id()); - $published = ModerationState::load('published'); - $entity_test_rev->moderation_state->entity = $published; + $entity_test_rev->moderation_state->entity = 'published'; $entity_test_rev->save(); - $this->assertEquals('published', $entity_test_rev->moderation_state->entity->id()); + $this->assertEquals('published', EntityTestRev::load($entity_test_rev->id())->moderation_state->entity->id()); } /** diff --git a/core/modules/system/tests/modules/entity_test/entity_test.install b/core/modules/system/tests/modules/entity_test/entity_test.install index 5e3bcaa..043f993 100644 --- a/core/modules/system/tests/modules/entity_test/entity_test.install +++ b/core/modules/system/tests/modules/entity_test/entity_test.install @@ -13,6 +13,10 @@ * Implements hook_install(). */ function entity_test_install() { + \Drupal\entity_test\Entity\EntityTestRevType::create([ + 'id' => 'example', + 'label' => 'Example', + ])->save(); foreach (entity_test_entity_types() as $entity_type) { // Auto-create fields for testing. FieldStorageConfig::create(array( @@ -24,12 +28,12 @@ function entity_test_install() { FieldConfig::create([ 'entity_type' => $entity_type, 'field_name' => 'field_test_text', - 'bundle' => $entity_type, + 'bundle' => 'example', 'label' => 'Test text-field', 'translatable' => FALSE, ])->save(); - entity_get_form_display($entity_type, $entity_type, 'default') + entity_get_form_display($entity_type, 'example', 'default') ->setComponent('field_test_text', array('type' => 'text_textfield')) ->save(); } diff --git a/core/modules/system/tests/modules/entity_test/src/Entity/EntityTestRev.php b/core/modules/system/tests/modules/entity_test/src/Entity/EntityTestRev.php index 97e8ecd..90eea9f 100644 --- a/core/modules/system/tests/modules/entity_test/src/Entity/EntityTestRev.php +++ b/core/modules/system/tests/modules/entity_test/src/Entity/EntityTestRev.php @@ -20,7 +20,6 @@ * "delete" = "Drupal\entity_test\EntityTestDeleteForm" * }, * "view_builder" = "Drupal\entity_test\EntityTestViewBuilder", - * "translation" = "Drupal\content_translation\ContentTranslationHandler", * "views_data" = "Drupal\views\EntityViewsData", * "route_provider" = { * "html" = "Drupal\Core\Entity\Routing\DefaultHtmlRouteProvider", @@ -36,7 +35,6 @@ * "revision" = "revision_id", * "bundle" = "type", * "label" = "name", - * "langcode" = "langcode", * }, * links = { * "add-form" = "/entity_test_rev/add", @@ -61,7 +59,6 @@ public static function baseFieldDefinitions(EntityTypeInterface $entity_type) { ->setReadOnly(TRUE) ->setSetting('unsigned', TRUE); - $fields['langcode']->setRevisionable(TRUE); $fields['name']->setRevisionable(TRUE); $fields['user_id']->setRevisionable(TRUE);