protected function TimezoneTest::setupForm in Drupal 9
Same name and namespace in other branches
- 8 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 367
Class
- TimezoneTest
- Tests the timezone handling of datetime and datelist element types.
Namespace
Drupal\KernelTests\Core\Datetime\ElementCode
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);
}