You are here

public function DatetimeElementFormTest::datetimeDateCallback in Drupal 10

Same name and namespace in other branches
  1. 9 core/tests/Drupal/KernelTests/Core/Datetime/DatetimeElementFormTest.php \Drupal\KernelTests\Core\Datetime\DatetimeElementFormTest::datetimeDateCallback()

File

core/tests/Drupal/KernelTests/Core/Datetime/DatetimeElementFormTest.php, line 55

Class

DatetimeElementFormTest
Tests DatetimeElement functionality.

Namespace

Drupal\KernelTests\Core\Datetime

Code

public function datetimeDateCallback(array &$element, FormStateInterface $form_state, DrupalDateTime $date = NULL) {
  $element['datetimeDateCallbackExecuted'] = [
    '#value' => TRUE,
  ];
  $form_state
    ->set('datetimeDateCallbackExecuted', TRUE);
}