function TimezoneTest::setupForm

Same name in other branches
  1. 8.9.x core/tests/Drupal/KernelTests/Core/Datetime/Element/TimezoneTest.php \Drupal\KernelTests\Core\Datetime\Element\TimezoneTest::setupForm()
  2. 10 core/tests/Drupal/KernelTests/Core/Datetime/Element/TimezoneTest.php \Drupal\KernelTests\Core\Datetime\Element\TimezoneTest::setupForm()
  3. 11.x core/tests/Drupal/KernelTests/Core/Datetime/Element/TimezoneTest.php \Drupal\KernelTests\Core\Datetime\Element\TimezoneTest::setupForm()

Simulate form being loaded and default values displayed to user.

Parameters

\Drupal\Core\Form\FormStateInterface $form_state: A form_state object.

\Drupal\Core\Form\FormBuilderInterface $form_builder: A form_builder object.

Return value

\Drupal\Core\Form\FormStateInterface The modified form state.

2 calls to TimezoneTest::setupForm()
TimezoneTest::assertDateTimezonePropertyProcessed in core/tests/Drupal/KernelTests/Core/Datetime/Element/TimezoneTest.php
Asserts that elements set #date_timezone correctly.
TimezoneTest::assertTimesUnderstoodCorrectly in core/tests/Drupal/KernelTests/Core/Datetime/Element/TimezoneTest.php
Asserts that elements interpret dates using the expected time zones.

File

core/tests/Drupal/KernelTests/Core/Datetime/Element/TimezoneTest.php, line 371

Class

TimezoneTest
Tests the timezone handling of datetime and datelist element types.

Namespace

Drupal\KernelTests\Core\Datetime\Element

Code

protected function setupForm(FormStateInterface $form_state, FormBuilderInterface $form_builder) {
    $form_id = $form_builder->getFormId($this, $form_state);
    $form = $form_builder->retrieveForm($form_id, $form_state);
    $form_state->setValidationEnforced();
    $form_state->clearErrors();
    $form_builder->prepareForm($form_id, $form, $form_state);
    $form_builder->processForm($form_id, $form, $form_state);
    return $form_builder->retrieveForm($form_id, $form_state);
}

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