mirror of
https://github.com/flextype/flextype.git
synced 2025-08-22 04:42:57 +02:00
feat(shortcodes): add const
shortcode
This commit is contained in:
3
tests/fixtures/settings/settings.yaml
vendored
3
tests/fixtures/settings/settings.yaml
vendored
@@ -645,6 +645,9 @@ parsers:
|
||||
uuid:
|
||||
enabled: true
|
||||
path: "/src/flextype/core/Parsers/Shortcodes/UuidShortcode.php"
|
||||
const:
|
||||
enabled: true
|
||||
path: "/src/flextype/core/Parsers/Shortcodes/ConstShortcode.php"
|
||||
var:
|
||||
enabled: true
|
||||
path: "/src/flextype/core/Parsers/Shortcodes/VarShortcode.php"
|
||||
|
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
beforeEach(function() {
|
||||
filesystem()->directory(PATH['project'] . '/entries')->ensureExists(0755, true);
|
||||
});
|
||||
|
||||
afterEach(function () {
|
||||
filesystem()->directory(PATH['project'] . '/entries')->delete();
|
||||
});
|
||||
|
||||
test('const shortcode', function () {
|
||||
define('foo', 'Foo');
|
||||
expect(entries()->create('const', ['test' => '(const:foo)']))->toBeTrue();
|
||||
expect(entries()->fetch('const')['test'])->toBe('Foo');
|
||||
});
|
Reference in New Issue
Block a user