X-Git-Url: http://aleph1.co.uk/gitweb/?a=blobdiff_plain;f=web%2Fcore%2Fmodules%2Fcontent_moderation%2Ftests%2Fsrc%2FKernel%2FEntityStateChangeValidationTest.php;h=aeed8486f5b652c425562585cfbd0c6992b9a9a9;hb=af6d1fb995500ae68849458ee10d66abbdcfb252;hp=2fefc0148c56a1b483a84c52e64c6f9513e5f522;hpb=9917807b03b64faf00f6a1f29dcb6eafc454efa5;p=yaffs-website diff --git a/web/core/modules/content_moderation/tests/src/Kernel/EntityStateChangeValidationTest.php b/web/core/modules/content_moderation/tests/src/Kernel/EntityStateChangeValidationTest.php index 2fefc0148..aeed8486f 100644 --- a/web/core/modules/content_moderation/tests/src/Kernel/EntityStateChangeValidationTest.php +++ b/web/core/modules/content_moderation/tests/src/Kernel/EntityStateChangeValidationTest.php @@ -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();