mirror of
https://github.com/flextype/flextype.git
synced 2025-08-26 22:44:25 +02:00
feat(shortcodes): add type
shortcode
This commit is contained in:
3
tests/fixtures/settings/settings.yaml
vendored
3
tests/fixtures/settings/settings.yaml
vendored
@@ -611,6 +611,9 @@ parsers:
|
||||
eval:
|
||||
enabled: true
|
||||
path: "/src/flextype/core/Parsers/Shortcodes/EvalShortcode.php"
|
||||
type:
|
||||
enabled: true
|
||||
path: "/src/flextype/core/Parsers/Shortcodes/TypeShortcode.php"
|
||||
|
||||
# CORS
|
||||
#
|
||||
|
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
beforeEach(function() {
|
||||
filesystem()->directory(PATH['project'] . '/entries')->ensureExists(0755, true);
|
||||
});
|
||||
|
||||
afterEach(function () {
|
||||
filesystem()->directory(PATH['project'] . '/entries')->delete();
|
||||
});
|
||||
|
||||
test('type shortcode', function () {
|
||||
expect(entries()->create('test-1', ['price' => '(type:int) 10']))->toBeTrue();
|
||||
expect(entries()->fetch('test-1')['price'])->toBe(10);
|
||||
|
||||
expect(entries()->create('test-2', ['price' => '(type:string) 10']))->toBeTrue();
|
||||
expect(entries()->fetch('test-2')['price'])->toBe('10');
|
||||
});
|
Reference in New Issue
Block a user