diff --git a/core/modules/system/tests/src/Functional/System/PageTitleTest.php b/core/modules/system/tests/src/Functional/System/PageTitleTest.php index 5aa2b99..46c8abe 100644 --- a/core/modules/system/tests/src/Functional/System/PageTitleTest.php +++ b/core/modules/system/tests/src/Functional/System/PageTitleTest.php @@ -160,16 +160,4 @@ public function testRoutingTitle() { $this->assertRaw(Html::escape('Cached title') . ''); } - /** - * Tests that the site slogan has the correct maxlength. - */ - public function testSloganSize() { - // Test slogan size. - $edit = [ - 'site_slogan' => $this->randomMachineName(255), - ]; - $this->drupalPostForm('admin/config/system/site-information', $edit, t('Save configuration')); - $this->assertRaw(t('The configuration options have been saved.')); - } - } diff --git a/core/modules/system/tests/src/Functional/System/SiteInformationFormTest.php b/core/modules/system/tests/src/Functional/System/SiteInformationFormTest.php new file mode 100644 index 0000000..6fa6b36 --- /dev/null +++ b/core/modules/system/tests/src/Functional/System/SiteInformationFormTest.php @@ -0,0 +1,49 @@ +drupalLogin($this->drupalCreateUser(['administer site configuration', 'link to any page'])); + } + + /** + * Tests that the site slogan has the correct maxlength. + */ + public function testSloganSize() { + $slogan_maxlength = 255; + + $edit = [ + 'site_slogan' => $this->randomMachineName($slogan_maxlength), + ]; + $this->drupalPostForm('admin/config/system/site-information', $edit, t('Save configuration')); + $this->assertSession()->responseContains('The configuration options have been saved.'); + + $edit = [ + 'site_slogan' => $this->randomMachineName($slogan_maxlength + 1), + ]; + $this->drupalPostForm('admin/config/system/site-information', $edit, t('Save configuration')); + $placeholders = [ + '%maxlength' => $slogan_maxlength, + '%out_of_size' => $slogan_maxlength + 1, + ]; + $this->assertSession()->responseContains(t('Slogan cannot be longer than %maxlength characters but is currently %out_of_size characters long.', $placeholders)); + } + +}