function ElementTest::testSubmitButtonAttribute

Tests the submit_button attribute.

1 call to ElementTest::testSubmitButtonAttribute()
ElementTest::testFormElements in core/modules/system/tests/src/Functional/Form/ElementTest.php
Test form elements.

File

core/modules/system/tests/src/Functional/Form/ElementTest.php, line 155

Class

ElementTest
Tests building and processing of core form elements.

Namespace

Drupal\Tests\system\Functional\Form

Code

protected function testSubmitButtonAttribute() : void {
    // Set the submit_button attribute to true
    $this->drupalGet('form-test/submit-button-attribute');
    $this->assertSession()
        ->elementsCount('xpath', '//input[@type="submit"]', 1);
    // Set the submit_button attribute to false
    $this->drupalGet('form-test/submit-button-attribute/1');
    $this->assertSession()
        ->elementsCount('xpath', '//input[@type="button"]', 1);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.