function ConfigTargetTest::testTree

Same name in this branch
  1. 10 core/modules/system/tests/src/FunctionalJavascript/Form/ConfigTargetTest.php \Drupal\Tests\system\FunctionalJavascript\Form\ConfigTargetTest::testTree()
Same name and namespace in other branches
  1. 11.x core/modules/system/tests/src/FunctionalJavascript/Form/ConfigTargetTest.php \Drupal\Tests\system\FunctionalJavascript\Form\ConfigTargetTest::testTree()
  2. 11.x core/modules/system/tests/src/Functional/Form/ConfigTargetTest.php \Drupal\Tests\system\Functional\Form\ConfigTargetTest::testTree()

Tests #config_target where #tree is set to TRUE.

File

core/modules/system/tests/src/Functional/Form/ConfigTargetTest.php, line 29

Class

ConfigTargetTest
Tests forms using #config_target.

Namespace

Drupal\Tests\system\Functional\Form

Code

public function testTree() : void {
  $this->drupalGet('/form-test/tree-config-target');
  $page = $this->getSession()
    ->getPage();
  $page->fillField('Favorite', '');
  $page->pressButton('Save configuration');
  $assert_session = $this->assertSession();
  $assert_session->statusMessageContains('This value should not be blank.', 'error');
  $assert_session->elementAttributeExists('named', [
    'field',
    'Favorite',
  ], 'aria-invalid');
  $assert_session->elementAttributeNotExists('named', [
    'field',
    'Nemesis',
  ], 'aria-invalid');
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.