mirror of
https://github.com/flextype/flextype.git
synced 2025-08-06 13:16:45 +02:00
feat(tests): add tests for [url] shortcode
This commit is contained in:
@@ -2,8 +2,26 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
test('[url] shortcode', function () {
|
||||
registry()->set('flextype.settings.url', 'https://awilum.github.io/flextype');
|
||||
test('[getBaseUrl] shortcode', function () {
|
||||
registry()->set('flextype.settings.base_url', 'https://awilum.github.io/flextype');
|
||||
|
||||
$this->assertStringContainsString('https://awilum.github.io/flextype', parsers()->shortcodes()->parse('[url]'));
|
||||
$this->assertStringContainsString('https://awilum.github.io/flextype', parsers()->shortcodes()->parse('[getBaseUrl]'));
|
||||
});
|
||||
|
||||
test('[getBasePath] shortcode', function () {
|
||||
app()->setBasePath('/foo/');
|
||||
|
||||
$this->assertStringContainsString('/foo/', parsers()->shortcodes()->parse('[getBasePath]'));
|
||||
});
|
||||
|
||||
test('[getAbsoluteUrl] shortcode', function () {
|
||||
$this->assertStringContainsString('/', parsers()->shortcodes()->parse('[getAbsoluteUrl]'));
|
||||
});
|
||||
|
||||
test('[getUriString] shortcode', function () {
|
||||
$this->assertStringContainsString('', parsers()->shortcodes()->parse('[getUriString]'));
|
||||
});
|
||||
|
||||
test('[urlFor] shortcode', function () {
|
||||
$this->assertStringContainsString('', parsers()->shortcodes()->parse('[urlFor routeName="test-route" queryParams=\'{"foo": "Foo"}\']'));
|
||||
});
|
Reference in New Issue
Block a user