function DatetimeElementFormTest::datetimeTimeCallback

Same name in other branches
  1. 9 core/tests/Drupal/KernelTests/Core/Datetime/DatetimeElementFormTest.php \Drupal\KernelTests\Core\Datetime\DatetimeElementFormTest::datetimeTimeCallback()
  2. 11.x core/tests/Drupal/KernelTests/Core/Datetime/DatetimeElementFormTest.php \Drupal\KernelTests\Core\Datetime\DatetimeElementFormTest::datetimeTimeCallback()

File

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

Class

DatetimeElementFormTest
Tests DatetimeElement functionality.

Namespace

Drupal\KernelTests\Core\Datetime

Code

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

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