You are here

protected function TimezoneTest::setupForm in Drupal 10

Same name and namespace in other branches
  1. 8 core/tests/Drupal/KernelTests/Core/Datetime/Element/TimezoneTest.php \Drupal\KernelTests\Core\Datetime\Element\TimezoneTest::setupForm()
  2. 9 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.

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);
}