1
0
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:
Awilum
2020-10-20 22:40:25 +03:00
parent 8ddc94e450
commit 0a2fc5c46e

View 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"]'));
});