class ElementsContainerTest
Same name and namespace in other branches
- 11.x core/modules/system/tests/src/Functional/Form/ElementsContainerTest.php \Drupal\Tests\system\Functional\Form\ElementsContainerTest
- 10 core/modules/system/tests/src/Functional/Form/ElementsContainerTest.php \Drupal\Tests\system\Functional\Form\ElementsContainerTest
- 8.9.x core/modules/system/tests/src/Functional/Form/ElementsContainerTest.php \Drupal\Tests\system\Functional\Form\ElementsContainerTest
Tests the container form element for expected behavior.
@group Form
Hierarchy
- class \Drupal\Tests\BrowserTestBase uses \Drupal\Core\Test\FunctionalTestSetupTrait, \Drupal\Tests\UiHelperTrait, \Drupal\Core\Test\TestSetupTrait, \Drupal\Tests\block\Traits\BlockCreationTrait, \Drupal\FunctionalTests\AssertLegacyTrait, \Drupal\Tests\RandomGeneratorTrait, \Drupal\Tests\node\Traits\NodeCreationTrait, \Drupal\Tests\node\Traits\ContentTypeCreationTrait, \Drupal\Tests\ConfigTestTrait, \Drupal\Tests\TestRequirementsTrait, \Drupal\Tests\user\Traits\UserCreationTrait, \Drupal\Tests\XdebugRequestTrait, \Drupal\Tests\Traits\PhpUnitWarnings, \Drupal\Tests\PhpUnitCompatibilityTrait, \Symfony\Bridge\PhpUnit\ExpectDeprecationTrait, \Drupal\Tests\ExtensionListTestTrait extends \PHPUnit\Framework\TestCase
- class \Drupal\Tests\system\Functional\Form\ElementsContainerTest extends \Drupal\Tests\BrowserTestBase
Expanded class hierarchy of ElementsContainerTest
File
-
core/
modules/ system/ tests/ src/ Functional/ Form/ ElementsContainerTest.php, line 12
Namespace
Drupal\Tests\system\Functional\FormView source
class ElementsContainerTest extends BrowserTestBase {
/**
* Modules to enable.
*
* @var array
*/
protected static $modules = [
'form_test',
];
/**
* {@inheritdoc}
*/
protected $defaultTheme = 'stark';
/**
* Tests the #optional container property.
*/
public function testOptionalContainerElements() {
$this->drupalGet('form-test/optional-container');
$assertSession = $this->assertSession();
$assertSession->elementNotExists('css', 'div.empty_optional');
$assertSession->elementExists('css', 'div.empty_nonoptional');
$assertSession->elementExists('css', 'div.nonempty_optional');
$assertSession->elementExists('css', 'div.nonempty_nonoptional');
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.