function ElementTest::testGroupElements in Zircon Profile 8
Same name and namespace in other branches
- 8.0 core/modules/system/src/Tests/Form/ElementTest.php \Drupal\system\Tests\Form\ElementTest::testGroupElements()
Tests the #group property.
File
- core/
modules/ system/ src/ Tests/ Form/ ElementTest.php, line 128 - Contains \Drupal\system\Tests\Form\ElementTest.
Class
- ElementTest
- Tests building and processing of core form elements.
Namespace
Drupal\system\Tests\FormCode
function testGroupElements() {
$this
->drupalGet('form-test/group-details');
$elements = $this
->xpath('//div[@class="details-wrapper"]//div[@class="details-wrapper"]//label');
$this
->assertTrue(count($elements) == 1);
$this
->drupalGet('form-test/group-container');
$elements = $this
->xpath('//div[@id="edit-container"]//div[@class="details-wrapper"]//label');
$this
->assertTrue(count($elements) == 1);
$this
->drupalGet('form-test/group-fieldset');
$elements = $this
->xpath('//fieldset[@id="edit-fieldset"]//div[@id="edit-meta"]//label');
$this
->assertTrue(count($elements) == 1);
$this
->drupalGet('form-test/group-vertical-tabs');
$elements = $this
->xpath('//div[@data-vertical-tabs-panes]//details[@id="edit-meta"]//label');
$this
->assertTrue(count($elements) == 1);
$elements = $this
->xpath('//div[@data-vertical-tabs-panes]//details[@id="edit-meta-2"]//label');
$this
->assertTrue(count($elements) == 1);
}