Skip to content
Snippets Groups Projects
Verified Commit f82e35fb authored by Théodore Biadala's avatar Théodore Biadala
Browse files

Issue #3463548 by catch, smustgrave: Consolidate methods on FormElementsLabelsTest

parent ae638ca0
No related branches found
No related tags found
Loading
Pipeline #235267 canceled
Pipeline: drupal

#235272

    ......@@ -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.
    *
    ......@@ -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
    ......@@ -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!");
    ......@@ -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'.
    ......@@ -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.
    ......
    0% Loading or .
    You are about to add 0 people to the discussion. Proceed with caution.
    Please register or to comment