function ElementTest::testChildAttributes
Tests checkboxes and radios child element attributes.
1 call to ElementTest::testChildAttributes()
- 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 145
Class
- ElementTest
- Tests building and processing of core form elements.
Namespace
Drupal\Tests\system\Functional\FormCode
protected function testChildAttributes() : void {
$this->drupalGet('form-test/checkboxes-radios');
// Verify that the child elements don't have aria-describedby attributes.
$this->assertSession()
->elementsCount('xpath', "//input[@type='checkbox' and @aria-describedby]", 0);
$this->assertSession()
->elementsCount('xpath', "//input[@type='radio' and @aria-describedby]", 0);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.