- // Check the last revision is set as current.
- $text = $this->xpath('//tbody/tr[1]/td[4]/em');
- $this->assertEqual($text[0], 'Current revision');
- $this->assertNoLink(t('Set as current revision'));
+ if (\Drupal::moduleHandler()->moduleExists('content_moderation')) {
+ // With content moderation, the new revision will not be current.
+ // @see https://www.drupal.org/node/2899719
+ $text = $this->xpath('//tbody/tr[1]/td[4]/div/div/ul/li/a');
+ $this->assertEqual($text[0], 'Set as current revision');
+ }
+ else {
+ // Check the last revision is set as current.
+ $text = $this->xpath('//tbody/tr[1]/td[4]/em');
+ $this->assertEqual($text[0], 'Current revision');
+ $this->assertNoLink(t('Set as current revision'));
+ }