mirror of
https://github.com/flextype/flextype.git
synced 2025-08-08 14:16:46 +02:00
feat(tests): add tests for Shortcode entries_fetch #477
This commit is contained in:
17
tests/Support/Parsers/Shortcodes/EntriesShortcodeTest.php
Normal file
17
tests/Support/Parsers/Shortcodes/EntriesShortcodeTest.php
Normal file
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
beforeEach(function() {
|
||||
filesystem()->directory(PATH['project'] . '/entries')->create();
|
||||
});
|
||||
|
||||
afterEach(function (): void {
|
||||
filesystem()->directory(PATH['project'] . '/entries')->delete();
|
||||
});
|
||||
|
||||
test('test entries_fetch shortcode', function () {
|
||||
$this->assertTrue(flextype('entries')->create('foo', ['title' => 'Foo']));
|
||||
$this->assertEquals('Foo', flextype('shortcode')->process('[entries_fetch id="foo" field="title"]'));
|
||||
$this->assertEquals('Bar', flextype('shortcode')->process('[entries_fetch id="foo" field="bar" default="Bar"]'));
|
||||
});
|
Reference in New Issue
Block a user