diff --git a/src/Tests/DiffRevisionContentModerationTest.php b/src/Tests/DiffRevisionContentModerationTest.php index 7490b19..f3fceda 100644 --- a/src/Tests/DiffRevisionContentModerationTest.php +++ b/src/Tests/DiffRevisionContentModerationTest.php @@ -67,7 +67,34 @@ class DiffRevisionContentModerationTest extends DiffRevisionTest { * Test content moderation integration. */ protected function doTestContentModeration() { - + $title = $this->randomString(); + $node = $this->createNode([ + 'type' => 'article', + 'title' => $title, + ]); + + // Add another draft. + $node->title = $title . ' change 1'; + $node->save(); + + // Publish. + $node->moderation_state = 'published'; + $node->save(); + + // Another draft. + $node->title = $title . ' change 2'; + $node->moderation_state = 'draft'; + $node->save(); + + // Verify moderation state information appears on revision overview. + $this->drupalGet($node->toUrl('version-history')); + + // Verify proper moderation states are displayed. + $diff_rows = $this->xpath('//tbody/tr/td[1]/p'); + $this->assertEqual('Changes on: Title (Draft)', (string) $diff_rows[0]); + $this->assertEqual('No changes. (Published)', (string) $diff_rows[1]); + $this->assertEqual('Changes on: Title (Draft)', (string) $diff_rows[2]); + $this->assertEqual('Initial revision. (Draft)', (string) $diff_rows[3]); } }