Loading core/modules/system/tests/src/Functional/Form/ElementsLabelsTest.php +14 −4 Original line number Diff line number Diff line Loading @@ -26,6 +26,16 @@ class ElementsLabelsTest extends BrowserTestBase { */ protected $defaultTheme = 'stark'; /** * Tests form elements. */ public function testFormElements(): void { $this->testFormLabels(); $this->testTitleEscaping(); $this->testFormDescriptions(); $this->testFormsInThemeLessEnvironments(); } /** * Tests form element rendering. * Loading @@ -35,7 +45,7 @@ class ElementsLabelsTest extends BrowserTestBase { * - Prefix and suffix render element placement. * - Form element title attributes. */ public function testFormLabels(): void { protected function testFormLabels(): void { $this->drupalGet('form_test/form-labels'); // Check that the checkbox/radio processing is not interfering with Loading Loading @@ -104,7 +114,7 @@ public function testFormLabels(): void { /** * Tests XSS-protection of element labels. */ public function testTitleEscaping(): void { protected function testTitleEscaping(): void { $this->drupalGet('form_test/form-labels'); foreach (FormTestLabelForm::$typesWithTitle as $type) { $this->assertSession()->responseContains("$type alert('XSS') is XSS filtered!"); Loading @@ -115,7 +125,7 @@ public function testTitleEscaping(): void { /** * Tests different display options for form element descriptions. */ public function testFormDescriptions(): void { protected function testFormDescriptions(): void { $this->drupalGet('form_test/form-descriptions'); // Check #description placement with #description_display='after'. Loading @@ -142,7 +152,7 @@ public function testFormDescriptions(): void { /** * Tests forms in theme-less environments. */ public function testFormsInThemeLessEnvironments(): void { protected function testFormsInThemeLessEnvironments(): void { $form = $this->getFormWithLimitedProperties(); $render_service = $this->container->get('renderer'); // This should not throw any notices. Loading Loading
core/modules/system/tests/src/Functional/Form/ElementsLabelsTest.php +14 −4 Original line number Diff line number Diff line Loading @@ -26,6 +26,16 @@ class ElementsLabelsTest extends BrowserTestBase { */ protected $defaultTheme = 'stark'; /** * Tests form elements. */ public function testFormElements(): void { $this->testFormLabels(); $this->testTitleEscaping(); $this->testFormDescriptions(); $this->testFormsInThemeLessEnvironments(); } /** * Tests form element rendering. * Loading @@ -35,7 +45,7 @@ class ElementsLabelsTest extends BrowserTestBase { * - Prefix and suffix render element placement. * - Form element title attributes. */ public function testFormLabels(): void { protected function testFormLabels(): void { $this->drupalGet('form_test/form-labels'); // Check that the checkbox/radio processing is not interfering with Loading Loading @@ -104,7 +114,7 @@ public function testFormLabels(): void { /** * Tests XSS-protection of element labels. */ public function testTitleEscaping(): void { protected function testTitleEscaping(): void { $this->drupalGet('form_test/form-labels'); foreach (FormTestLabelForm::$typesWithTitle as $type) { $this->assertSession()->responseContains("$type alert('XSS') is XSS filtered!"); Loading @@ -115,7 +125,7 @@ public function testTitleEscaping(): void { /** * Tests different display options for form element descriptions. */ public function testFormDescriptions(): void { protected function testFormDescriptions(): void { $this->drupalGet('form_test/form-descriptions'); // Check #description placement with #description_display='after'. Loading @@ -142,7 +152,7 @@ public function testFormDescriptions(): void { /** * Tests forms in theme-less environments. */ public function testFormsInThemeLessEnvironments(): void { protected function testFormsInThemeLessEnvironments(): void { $form = $this->getFormWithLimitedProperties(); $render_service = $this->container->get('renderer'); // This should not throw any notices. Loading