diff --git a/tests/src/flextype/core/Entries/Directives/FieldsDirectiveTest.php b/tests/src/flextype/core/Entries/Directives/FieldsDirectiveTest.php index 2b71415c..a70a5b7a 100644 --- a/tests/src/flextype/core/Entries/Directives/FieldsDirectiveTest.php +++ b/tests/src/flextype/core/Entries/Directives/FieldsDirectiveTest.php @@ -13,4 +13,11 @@ afterEach(function (): void { test('fields directive', function () { entries()->create('field', ['foo' => '@field[id]']); $this->assertEquals('field', entries()->fetch('field')['foo']); +}); + +test('fields directive disabled', function () { + registry()->set('flextype.settings.entries.directives.fields.enabled', false); + entries()->create('field', ['foo' => '@field[id]']); + $this->assertEquals('@field[id]', entries()->fetch('field')['foo']); + registry()->set('flextype.settings.entries.directives.fields.enabled', true); }); \ No newline at end of file diff --git a/tests/src/flextype/core/Entries/Directives/MarkdownDirectiveTest.php b/tests/src/flextype/core/Entries/Directives/MarkdownDirectiveTest.php index 1c85aebe..189d09a5 100644 --- a/tests/src/flextype/core/Entries/Directives/MarkdownDirectiveTest.php +++ b/tests/src/flextype/core/Entries/Directives/MarkdownDirectiveTest.php @@ -14,4 +14,11 @@ test('markdown directive', function () { entries()->create('markdown', ['foo' => '@markdown **Hello world!**']); $this->assertEquals('

Hello world!

', entries()->fetch('markdown')['foo']); +}); + +test('markdown directive disabled', function () { + registry()->set('flextype.settings.entries.directives.markdown.enabled', false); + entries()->create('markdown', ['foo' => '@markdown **Hello world!**']); + $this->assertEquals('@markdown **Hello world!**', entries()->fetch('markdown')['foo']); + registry()->set('flextype.settings.entries.directives.markdown.enabled', true); }); \ No newline at end of file diff --git a/tests/src/flextype/core/Entries/Directives/PhpDirectiveTest.php b/tests/src/flextype/core/Entries/Directives/PhpDirectiveTest.php index eeae6606..0f542696 100644 --- a/tests/src/flextype/core/Entries/Directives/PhpDirectiveTest.php +++ b/tests/src/flextype/core/Entries/Directives/PhpDirectiveTest.php @@ -14,4 +14,11 @@ test('php directive', function () { entries()->create('type-php', ['title' => '@php echo "Foo";']); $this->assertEquals('Foo', entries()->fetch('type-php')['title']); +}); + +test('php directive disabled', function () { + registry()->set('flextype.settings.entries.directives.php.enabled', false); + entries()->create('type-php', ['title' => '@php echo "Foo";']); + $this->assertEquals('@php echo "Foo";', entries()->fetch('type-php')['title']); + registry()->set('flextype.settings.entries.directives.php.enabled', true); }); \ No newline at end of file diff --git a/tests/src/flextype/core/Entries/Directives/ShortcodesDirectiveTest.php b/tests/src/flextype/core/Entries/Directives/ShortcodesDirectiveTest.php index 4d7c4800..52c7be9a 100644 --- a/tests/src/flextype/core/Entries/Directives/ShortcodesDirectiveTest.php +++ b/tests/src/flextype/core/Entries/Directives/ShortcodesDirectiveTest.php @@ -14,4 +14,11 @@ test('shortcodes directive', function () { 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']); + registry()->set('flextype.settings.entries.directives.shortcodes.enabled', true); }); \ No newline at end of file diff --git a/tests/src/flextype/core/Entries/Directives/TextileDirectiveTest.php b/tests/src/flextype/core/Entries/Directives/TextileDirectiveTest.php index 9c74bf84..96168426 100644 --- a/tests/src/flextype/core/Entries/Directives/TextileDirectiveTest.php +++ b/tests/src/flextype/core/Entries/Directives/TextileDirectiveTest.php @@ -14,4 +14,11 @@ test('textile directive', function () { entries()->create('textile', ['foo' => '@textile **Hello world!**']); $this->assertEquals('

Hello world!

', entries()->fetch('textile')['foo']); +}); + +test('textile directive disabled', function () { + registry()->set('flextype.settings.entries.directives.textile.enabled', false); + entries()->create('textile', ['foo' => '@textile **Hello world!**']); + $this->assertEquals('@textile **Hello world!**', entries()->fetch('textile')['foo']); + registry()->set('flextype.settings.entries.directives.textile.enabled', true); }); \ No newline at end of file diff --git a/tests/src/flextype/core/Entries/Directives/TypesDirectiveTest.php b/tests/src/flextype/core/Entries/Directives/TypesDirectiveTest.php index 76f776c4..06129fa9 100644 --- a/tests/src/flextype/core/Entries/Directives/TypesDirectiveTest.php +++ b/tests/src/flextype/core/Entries/Directives/TypesDirectiveTest.php @@ -41,4 +41,11 @@ test('types directive', function () { $this->assertEquals('{"foo":"Foo"}', entries()->fetch('type-json')['foo']); $this->assertEquals('{"foo": "Foo"}', entries()->fetch('type-json-2')['foo']); $this->assertEquals('[1,2,3,4,5]', entries()->fetch('type-json-3')['foo']); +}); + +test('types directive disabled', function () { + registry()->set('flextype.settings.entries.directives.types.enabled', false); + entries()->create('field', ['foo' => '@type[int] 100']); + $this->assertEquals('@type[int] 100', entries()->fetch('field')['foo']); + registry()->set('flextype.settings.entries.directives.types.enabled', true); }); \ No newline at end of file diff --git a/tests/src/flextype/core/Entries/Directives/VarsDirectiveTest.php b/tests/src/flextype/core/Entries/Directives/VarsDirectiveTest.php index 4c0917c1..ec94d58b 100644 --- a/tests/src/flextype/core/Entries/Directives/VarsDirectiveTest.php +++ b/tests/src/flextype/core/Entries/Directives/VarsDirectiveTest.php @@ -14,4 +14,11 @@ test('vars directive', function () { entries()->create('type-vars', ['vars' => ['foo' => 'Foo'], 'title' => '@var[foo]']); $this->assertEquals('Foo', entries()->fetch('type-vars')['title']); +}); + +test('vars directive disabled', function () { + registry()->set('flextype.settings.entries.directives.vars.enabled', false); + entries()->create('type-vars', ['vars' => ['foo' => 'Foo'], 'title' => '@var[foo]']); + $this->assertEquals('@var[foo]', entries()->fetch('type-vars')['title']); + registry()->set('flextype.settings.entries.directives.vars.enabled', true); }); \ No newline at end of file