reverted: --- b/core/modules/content_moderation/src/Tests/ModerationStateDuplicateLabelTest.php +++ /dev/null @@ -1,66 +0,0 @@ -drupalGet($path); - // No access. - $this->assertResponse(403); - } - $this->drupalLogin($this->adminUser); - foreach ($paths as $path) { - $this->drupalGet($path); - // User has access. - $this->assertResponse(200); - } - } - - /** - * Tests administration of moderation state transition entity. - */ - public function testDuplicateLabel() { - $duplicate_label = 'Draft'; - - $this->drupalLogin($this->adminUser); - $this->drupalGet('admin/config/workflow/moderation'); - $this->assertLink('Moderation states'); - $this->clickLink('Moderation states'); - $this->clickLink('Add Moderation state'); - // Add two states with the same label and one unique. - $this->drupalPostForm(NULL, [ - 'label' => $duplicate_label, - 'id' => 'duplicate', - ], t('Save')); - - /** @var ModerationState $state */ - foreach (ModerationState::loadMultiple() as $state) { - if ($state->id() === 'duplicate' || $state->id() === 'draft') { - $this->assertNotIdentical($state->label(FALSE), $state->label(), 'The labels are different.'); - } - else { - $this->assertIdentical($state->label(FALSE), $state->label(), 'The labels are identical.'); - } - } - } - -} diff -u b/core/modules/content_moderation/src/Tests/ModerationStateTransitionsTest.php b/core/modules/content_moderation/src/Tests/ModerationStateTransitionsTest.php --- b/core/modules/content_moderation/src/Tests/ModerationStateTransitionsTest.php +++ b/core/modules/content_moderation/src/Tests/ModerationStateTransitionsTest.php @@ -2,6 +2,8 @@ namespace Drupal\content_moderation\Tests; +use Drupal\content_moderation\Entity\ModerationState; + /** * Tests moderation state transition config entity. * @@ -86,6 +88,11 @@ $this->assertText('Are you sure you want to delete Published » Expired?'); $this->drupalPostForm(NULL, [], t('Delete')); $this->assertText('Moderation transition Published » Expired deleted'); + + /** @var ModerationState $state */ + foreach (ModerationState::loadMultiple() as $state) { + $this->assertIdentical($state->label(FALSE), $state->label(), 'The labels are identical.'); + } } }