function DatelistElementFormTest::testDatelistElement

Same name in other branches
  1. 10 core/tests/Drupal/KernelTests/Core/Datetime/DatelistElementFormTest.php \Drupal\KernelTests\Core\Datetime\DatelistElementFormTest::testDatelistElement()
  2. 11.x core/tests/Drupal/KernelTests/Core/Datetime/DatelistElementFormTest.php \Drupal\KernelTests\Core\Datetime\DatelistElementFormTest::testDatelistElement()

Tests that trusted callbacks are executed.

File

core/tests/Drupal/KernelTests/Core/Datetime/DatelistElementFormTest.php, line 109

Class

DatelistElementFormTest
Tests Datelist functionality.

Namespace

Drupal\KernelTests\Core\Datetime

Code

public function testDatelistElement() {
    $form_state = new FormState();
    $form = \Drupal::formBuilder()->buildForm($this, $form_state);
    $this->render($form);
    $this->assertTrue($form['datelist_element']['datelistDateCallbackExecuted']['#value']);
    $this->assertTrue($form_state->get('datelistDateCallbackExecuted'));
}

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