class ElementsContainerTest
Same name in this branch
- 11.x core/modules/system/tests/src/Functional/Form/ElementsContainerTest.php \Drupal\Tests\system\Functional\Form\ElementsContainerTest
Same name and namespace in other branches
- 10 core/modules/system/tests/src/Functional/Form/ElementsContainerTest.php \Drupal\Tests\system\Functional\Form\ElementsContainerTest
- 9 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
- main core/modules/system/tests/src/Functional/Form/ElementsContainerTest.php \Drupal\Tests\system\Functional\Form\ElementsContainerTest
- main core/modules/system/tests/src/Kernel/Form/ElementsContainerTest.php \Drupal\Tests\system\Kernel\Form\ElementsContainerTest
Tests the container form element for expected behavior.
Attributes
#[Group('Form')]
#[RunTestsInSeparateProcesses]
Hierarchy
- class \Drupal\KernelTests\KernelTestBase implements \Drupal\Core\DependencyInjection\ServiceProviderInterface uses \Drupal\Tests\DrupalTestCaseTrait, \Drupal\KernelTests\AssertContentTrait, \Drupal\Tests\RandomGeneratorTrait, \Drupal\Tests\ConfigTestTrait, \Drupal\Tests\ExtensionListTestTrait, \Drupal\Tests\TestRequirementsTrait, \Drupal\Tests\PhpUnitCompatibilityTrait, \Prophecy\PhpUnit\ProphecyTrait, \Drupal\TestTools\Extension\DeprecationBridge\ExpectDeprecationTrait, \Drupal\Tests\BrowserHtmlDebugTrait, \Drupal\Tests\HttpKernelUiHelperTrait extends \PHPUnit\Framework\TestCase
- class \Drupal\Tests\system\Kernel\Form\ElementsContainerTest extends \Drupal\KernelTests\KernelTestBase
Expanded class hierarchy of ElementsContainerTest
File
-
core/
modules/ system/ tests/ src/ Kernel/ Form/ ElementsContainerTest.php, line 14
Namespace
Drupal\Tests\system\Kernel\FormView source
class ElementsContainerTest extends KernelTestBase {
/**
* {@inheritdoc}
*/
protected static $modules = [
'system',
'form_test',
];
/**
* Tests the #optional container property.
*/
public function testOptionalContainerElements() : void {
$this->drupalGet('form-test/optional-container');
$assertSession = $this->assertSession();
$assertSession->elementNotExists('css', 'div.empty_optional');
$assertSession->elementExists('css', 'div.empty_non_optional');
$assertSession->elementExists('css', 'div.nonempty_optional');
$assertSession->elementExists('css', 'div.nonempty_non_optional');
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.