ElementsContainerTest.php in Drupal 9
File
core/modules/system/tests/src/Functional/Form/ElementsContainerTest.php
View source
<?php
namespace Drupal\Tests\system\Functional\Form;
use Drupal\Tests\BrowserTestBase;
class ElementsContainerTest extends BrowserTestBase {
protected static $modules = [
'form_test',
];
protected $defaultTheme = 'stark';
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');
}
}