Version 1
[yaffs-website] / web / modules / contrib / token / tests / src / Kernel / DateTest.php
diff --git a/web/modules/contrib/token/tests/src/Kernel/DateTest.php b/web/modules/contrib/token/tests/src/Kernel/DateTest.php
new file mode 100644 (file)
index 0000000..c25bf03
--- /dev/null
@@ -0,0 +1,35 @@
+<?php
+
+namespace Drupal\Tests\token\Kernel;
+
+/**
+ * Tests date tokens.
+ *
+ * @group token
+ */
+class DateTest extends KernelTestBase {
+
+  /**
+   * Modules to enable.
+   *
+   * @var array
+   */
+  public static $modules = [];
+
+  /**
+   * {@inheritdoc}
+   */
+  protected function setUp() {
+    parent::setUp();
+    $this->installConfig(['system', 'token_module_test']);
+  }
+
+  function testDateTokens() {
+    $tokens = array(
+      'token_module_test' => '1984',
+      'invalid_format' => NULL,
+    );
+
+    $this->assertTokens('date', array('date' => 453859200), $tokens);
+  }
+}