Updated to Drupal 8.5. Core Media not yet in use.
[yaffs-website] / web / core / modules / content_moderation / tests / src / Kernel / EntityStateChangeValidationTest.php
index 2fefc0148c56a1b483a84c52e64c6f9513e5f522..aeed8486f5b652c425562585cfbd0c6992b9a9a9 100644 (file)
@@ -181,7 +181,7 @@ class EntityStateChangeValidationTest extends KernelTestBase {
     ]);
     $node->save();
 
-    $node_fr = $node->addTranslation('fr');
+    $node_fr = $node->addTranslation('fr', $node->toArray());
     $node_fr->setTitle('French Published Node');
     $node_fr->save();
     $this->assertEquals('published', $node_fr->moderation_state->value);
@@ -207,7 +207,7 @@ class EntityStateChangeValidationTest extends KernelTestBase {
     $this->assertCount(0, $violations);
 
     // From the latest french revision, there should also be no violation.
-    $node_fr = $node->getTranslation('fr');
+    $node_fr = Node::load($node->id())->getTranslation('fr');
     $this->assertEquals('published', $node_fr->moderation_state->value);
     $node_fr->moderation_state = 'archived';
     $violations = $node_fr->validate();
@@ -217,7 +217,7 @@ class EntityStateChangeValidationTest extends KernelTestBase {
   /**
    * Tests that content without prior moderation information can be moderated.
    */
-  public function testLegacyContent() {
+  public function testExistingContentWithNoModeration() {
     $node_type = NodeType::create([
       'type' => 'example',
     ]);
@@ -251,7 +251,7 @@ class EntityStateChangeValidationTest extends KernelTestBase {
   /**
    * Tests that content without prior moderation information can be translated.
    */
-  public function testLegacyMultilingualContent() {
+  public function testExistingMultilingualContentWithNoModeration() {
     // Enable French.
     ConfigurableLanguage::createFromLangcode('fr')->save();