diff --git a/core/modules/content_moderation/src/Tests/ModerationFormTest.php b/core/modules/content_moderation/src/Tests/ModerationFormTest.php index 1b7e133..e652b31 100644 --- a/core/modules/content_moderation/src/Tests/ModerationFormTest.php +++ b/core/modules/content_moderation/src/Tests/ModerationFormTest.php @@ -35,7 +35,7 @@ public function testModerationForm() { // Create new moderated content in draft. $this->drupalGet('node/add/moderated_content'); // Since the node is being created there is no current state. - $this->assertNoText('Current state:'); + $this->assertNoText('Current state'); $this->drupalPostForm(NULL, [ 'title[0][value]' => 'Some moderated content', @@ -60,11 +60,12 @@ public function testModerationForm() { $workflow = Workflow::load('editorial'); $workflow->setTransitionFromStates('create_new_draft', ['published'])->save(); $this->drupalGet($edit_path); - $this->assertText('Current state: Draft'); + $this->assertText('Current state'); + $current_state = $this->xpath('//div[@id="edit-moderation-state-0-current"]'); + $this->assertEqual('Draft', trim($current_state[0])); $this->assertFieldsByValue($this->xpath('//select[@id="edit-moderation-state-0-state"]'), 'published'); $workflow->setTransitionFromStates('create_new_draft', ['draft', 'published'])->save(); $this->drupalGet($edit_path); - $this->assertText('Current state: Draft'); $this->assertFieldsByValue($this->xpath('//select[@id="edit-moderation-state-0-state"]'), 'draft'); $this->assertText("Keep Draft"); @@ -93,6 +94,9 @@ public function testModerationForm() { $this->drupalGet($edit_path); $this->assertFieldsByValue($this->xpath('//select[@id="edit-moderation-state-0-state"]'), 'published'); $this->assertText("Keep Published"); + $this->assertText('Current state'); + $current_state = $this->xpath('//div[@id="edit-moderation-state-0-current"]'); + $this->assertEqual('Published', trim($current_state[0])); $this->drupalPostForm($edit_path, [ 'body[0][value]' => 'Fourth version of the content.', 'moderation_state[0][state]' => 'archived',