1
0
mirror of https://github.com/flextype/flextype.git synced 2025-08-07 05:36:54 +02:00

feat(shortcodes): change parameter_value_delimiter format

This commit is contained in:
Awilum
2022-05-25 12:13:11 +03:00
parent 421359f8ad
commit f1d7c669ce
2 changed files with 4 additions and 4 deletions

View File

@@ -11,14 +11,14 @@ afterEach(function (): void {
});
test('shortcodes directive', function () {
entries()->create('shortcodes', ['foo' => '@shortcodes (strings prepend:"Hello ")World(/strings)']);
entries()->create('shortcodes', ['foo' => "@shortcodes (strings prepend:'Hello ')World(/strings)"]);
$this->assertEquals('Hello World', entries()->fetch('shortcodes')['foo']);
});
test('shortcodes directive disabled', function () {
registry()->set('flextype.settings.entries.directives.shortcodes.enabled', false);
entries()->create('shortcodes', ['foo' => '@shortcodes (strings prepend:"Hello ")World(/strings)']);
$this->assertEquals('@shortcodes (strings prepend:"Hello ")World(/strings)', entries()->fetch('shortcodes')['foo']);
entries()->create('shortcodes', ['foo' => "@shortcodes (strings prepend:'Hello ')World(/strings)"]);
$this->assertEquals("@shortcodes (strings prepend:'Hello ')World(/strings)", entries()->fetch('shortcodes')['foo']);
registry()->set('flextype.settings.entries.directives.shortcodes.enabled', true);
});

View File

@@ -5,7 +5,7 @@ declare(strict_types=1);
test('(strings) shortcode', function () {
// lower
$this->assertEquals("zed foo bar", "(strings lower)zed foo bar(/strings)");
$this->assertEquals("zed foo bar", parsers()->shortcodes()->parse("(strings lower)zed foo bar(/strings)"));
// upper
$this->assertEquals("ZED FOO BAR", parsers()->shortcodes()->parse("(strings upper)zed foo bar(/strings)"));