diff --git a/core/modules/datetime/src/Tests/DateTimeFormInjectionTest.php b/core/modules/datetime/src/Tests/DateTimeFormInjectionTest.php
new file mode 100644
index 0000000..150c909
--- /dev/null
+++ b/core/modules/datetime/src/Tests/DateTimeFormInjectionTest.php
@@ -0,0 +1,119 @@
+<?php
+/**
+ * @file
+ * Contains \Drupal\datetime\Tests\DateTimeFormInjectionTest
+ */
+
+namespace Drupal\datetime\Tests;
+
+
+use Drupal\Core\Datetime\DrupalDateTime;
+use Drupal\Core\DependencyInjection\DependencySerializationTrait;
+use Drupal\Core\Form\FormInterface;
+use Drupal\Core\Form\FormState;
+use Drupal\Core\Form\FormStateInterface;
+use Drupal\simpletest\KernelTestBase;
+use Drupal\user\Entity\User;
+
+/**
+ * Tests serializing a form with an injected datetime instance.
+ *
+ * @group datetime
+ */
+class DateTimeFormInjectionTest extends KernelTestBase implements FormInterface {
+
+  use DependencySerializationTrait;
+
+  /**
+   * A Dblog logger instance.
+   *
+   * @var \Psr\Log\LoggerInterface
+   */
+  protected $logger;
+
+  /**
+   * Modules to enable.
+   *
+   * @var array
+   */
+  public static $modules = array('system', 'datetime');
+
+  /**
+   * {@inheritdoc}
+   */
+  public function getFormId() {
+    return 'datetime_test_injection_form';
+  }
+
+  /**
+   * Process callback.
+   *
+   * @param array $element
+   *   Form element
+   *
+   * @return array
+   *   Processed element.
+   */
+  public function process($element) {
+    return $element;
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function buildForm(array $form, FormStateInterface $form_state) {
+    $form['datelist_element'] = array(
+      '#title' => 'datelist test',
+      '#type' => 'datelist',
+      '#default_value' => new DrupalDateTime('2000-01-01 00:00:00'),
+      '#date_part_order' => array(
+        'month',
+        'day',
+        'year',
+        'hour',
+        'minute', 'ampm',
+      ),
+      '#date_text_parts' => array('year'),
+      '#date_year_range' => '2010:2020',
+      '#date_increment' => 15,
+    );
+    $form['#process'][] = [$this, 'process'];
+    return $form;
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function validateForm(array &$form, FormStateInterface $form_state) {}
+
+  /**
+   * {@inheritdoc}
+   */
+  public function submitForm(array &$form, FormStateInterface $form_state) {
+    $this->assertTrue(TRUE);
+    $form_state->setRebuild();
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  protected function setUp() {
+    parent::setUp();
+    $this->installSchema('system', ['key_value_expire', 'sequences']);
+  }
+
+  /**
+   * Tests db log injection serialization.
+   */
+  public function testDatetimeSerialization() {
+    $form_state = new FormState();
+    $form_state->setRequestMethod('POST');
+    $form_state->setCached();
+    $form_builder = $this->container->get('form_builder');
+    $form_id = $form_builder->getFormId($this, $form_state);
+    $form = $form_builder->retrieveForm($form_id, $form_state);
+    $form_builder->prepareForm($form_id, $form, $form_state);
+    $form_builder->processForm($form_id, $form, $form_state);
+  }
+
+}
