From 3e594b6398effe471753f4b04b337f17a87a62bd Mon Sep 17 00:00:00 2001 From: Awilum Date: Mon, 11 Jul 2022 13:44:27 +0300 Subject: [PATCH] feat(shortcodes): add `date` shortcode --- .../Parsers/Shortcodes/DateShortcodeTest.php | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 tests/src/flextype/core/Parsers/Shortcodes/DateShortcodeTest.php diff --git a/tests/src/flextype/core/Parsers/Shortcodes/DateShortcodeTest.php b/tests/src/flextype/core/Parsers/Shortcodes/DateShortcodeTest.php new file mode 100644 index 00000000..08bd08c9 --- /dev/null +++ b/tests/src/flextype/core/Parsers/Shortcodes/DateShortcodeTest.php @@ -0,0 +1,21 @@ +directory(FLEXTYPE_PATH_PROJECT . '/entries')->ensureExists(0755, true); +}); + +afterEach(function () { + filesystem()->directory(FLEXTYPE_PATH_PROJECT . '/entries')->delete(); +}); + +test('date shortcode', function () { + $date = date('F j, Y, g:i a'); + expect(entries()->create('date', ['date' => "(date:'F j, Y, g:i a')"]))->toBeTrue(); + expect(entries()->fetch('date')['date'])->toBe($date); +}); \ No newline at end of file