diff --git a/core/modules/content_translation/src/Tests/ContentTranslationUITestBase.php b/core/modules/content_translation/src/Tests/ContentTranslationUITestBase.php index d3a3ae0..31776e3 100644 --- a/core/modules/content_translation/src/Tests/ContentTranslationUITestBase.php +++ b/core/modules/content_translation/src/Tests/ContentTranslationUITestBase.php @@ -117,14 +117,6 @@ protected function doTestBasicTranslation() { ], ['language' => $language]); $this->drupalPostForm($add_url, $this->getEditValues($values, $langcode), $this->getFormSubmitActionForNewTranslation($entity, $langcode)); - $this->drupalGet($add_url); - $this->assertResponse('403', 'Once a translation exists access is denied to add form'); - // Ensure it is also a 403 for user 1. - $this->drupalLogin($this->rootUser); - $this->drupalGet($add_url); - $this->assertResponse('403', 'Once a translation exists access is denied to add form'); - $this->drupalLogin($this->translator); - // Assert that HTML is escaped in "all languages" in UI after SafeMarkup // change. if ($this->testHTMLEscapeForAllLanguages) { @@ -132,6 +124,14 @@ protected function doTestBasicTranslation() { $this->assertRaw('(all languages)'); } + $this->drupalGet($add_url); + $this->assertResponse('403', 'Once a translation exists access is denied to add form'); + // Ensure it is also a 403 for user 1. + $this->drupalLogin($this->rootUser); + $this->drupalGet($add_url); + $this->assertResponse('403', 'Once a translation exists access is denied to add form for a user '); + $this->drupalLogin($this->translator); + // Ensure that the content language cache context is not yet added to the // page. $storage = $this->container->get('entity_type.manager') diff --git a/core/modules/content_translation/tests/src/Functional/ContentTranslationUITestBase.php b/core/modules/content_translation/tests/src/Functional/ContentTranslationUITestBase.php index e69329c..7eec855 100644 --- a/core/modules/content_translation/tests/src/Functional/ContentTranslationUITestBase.php +++ b/core/modules/content_translation/tests/src/Functional/ContentTranslationUITestBase.php @@ -122,6 +122,14 @@ protected function doTestBasicTranslation() { $this->assertRaw('(all languages)'); } + $this->drupalGet($add_url); + $this->assertResponse('403', 'Once a translation exists access is denied to add form'); + // Ensure it is also a 403 for user 1. + $this->drupalLogin($this->rootUser); + $this->drupalGet($add_url); + $this->assertResponse('403', 'Once a translation exists access is denied to add form'); + $this->drupalLogin($this->translator); + // Ensure that the content language cache context is not yet added to the // page. $storage = $this->container->get('entity_type.manager')