1
0
mirror of https://github.com/flextype/flextype.git synced 2025-08-06 13:16:45 +02:00

feat(shortcodes): add date shortcode

This commit is contained in:
Awilum
2022-07-11 13:44:27 +03:00
parent d0fd6676f3
commit 3e594b6398

View File

@@ -0,0 +1,21 @@
<?php
declare(strict_types=1);
use function Glowy\Filesystem\filesystem;
use function Flextype\entries;
use function Flextype\registry;
beforeEach(function() {
filesystem()->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);
});