diff -u b/core/tests/Drupal/KernelTests/Core/Entity/EntityRepositoryRevisionTranslationTest.php b/core/tests/Drupal/KernelTests/Core/Entity/EntityRepositoryRevisionTranslationTest.php --- b/core/tests/Drupal/KernelTests/Core/Entity/EntityRepositoryRevisionTranslationTest.php +++ b/core/tests/Drupal/KernelTests/Core/Entity/EntityRepositoryRevisionTranslationTest.php @@ -39,7 +39,6 @@ ConfigurableLanguage::createFromLangcode('de')->save(); ConfigurableLanguage::createFromLangcode('it')->save(); -// $this->installEntitySchema('entity_test_mul'); $this->installEntitySchema('entity_test_mulrev'); } @@ -73,14 +72,14 @@ $pending_revision_translation = $pending_revision->getTranslation($de_langcode); $pending_revision_translation->name = 'pending revision - de'; + $pending_revision_translation->isDefaultRevision(FALSE); $pending_revision_translation->save(); $pending_revision_id = $pending_revision->getRevisionId(); $pending_revision = $storage->loadRevision($pending_revision_id); - // Change the value of the field in the default language, save the pending - // revision and check that the value of the field in the second language is - // also taken from the pending revision, *not* from the default revision. + // Change the field value of the default language pending revision and save + // to create a new revision. $pending_revision->name = 'updated pending revision - en'; $pending_revision->save(); @@ -90,9 +89,13 @@ $en_active = $this->entityRepository->getActive('entity_test_mulrev', $entity->id(), $en_contexts); $de_active = $this->entityRepository->getActive('entity_test_mulrev', $entity->id(), $de_contexts); - // Check active revision translations have the correct title. + // Check current default revision titles. + $this->assertEquals('default revision - en', $entity->label()); + $this->assertEquals('default revision - de', $entity->getTranslation($de_langcode)->label()); + + // Check titles of active revision translations from language context. + $this->assertEquals('updated pending revision - en', $en_active->name->value); $this->assertEquals('pending revision - de', $de_active->label()); - $this->assertEquals( 'updated pending revision - en', $en_active->name->value); } @@ -116 +119 @@ -} \ No newline at end of file +}