mirror of
https://github.com/flextype/flextype.git
synced 2025-08-20 20:01:37 +02:00
feat(parsers): standardise parsers container names with macroable ability for Parsers API. #519
This commit is contained in:
@@ -8,11 +8,11 @@ use Thunder\Shortcode\Events;
|
||||
use Thunder\Shortcode\Shortcode\ShortcodeInterface;
|
||||
|
||||
test('test getInstance() method', function () {
|
||||
$this->assertInstanceOf(ShortcodeFacade::class, flextype('parsers')->shortcode()->getInstance());
|
||||
$this->assertInstanceOf(Flextype\Support\Parsers\Shortcode::class, flextype('parsers')->shortcode()->getInstance());
|
||||
});
|
||||
|
||||
test('test addHandler() method', function () {
|
||||
$this->assertInstanceOf(ShortcodeFacade::class, flextype('parsers')->shortcode()->addHandler('foo', static function() { return ''; }));
|
||||
$this->assertInstanceOf(Thunder\Shortcode\ShortcodeFacade::class, flextype('parsers')->shortcode()->addHandler('foo', static function() { return ''; }));
|
||||
});
|
||||
|
||||
test('test addEventHandler() method', function () {
|
||||
@@ -24,13 +24,13 @@ test('test addEventHandler() method', function () {
|
||||
});
|
||||
|
||||
test('test parse() method', function () {
|
||||
$this->assertInstanceOf(ShortcodeFacade::class, flextype('parsers')->shortcode()->addHandler('bar', static function() { return ''; }));
|
||||
$this->assertInstanceOf(Thunder\Shortcode\ShortcodeFacade::class, flextype('parsers')->shortcode()->addHandler('bar', static function() { return ''; }));
|
||||
$this->assertTrue(is_array(flextype('parsers')->shortcode()->parse('[bar]')));
|
||||
$this->assertTrue(is_object(flextype('parsers')->shortcode()->parse('[bar]')[0]));
|
||||
});
|
||||
|
||||
test('test process() method', function () {
|
||||
$this->assertInstanceOf(ShortcodeFacade::class, flextype('parsers')->shortcode()->addHandler('zed', static function() { return 'Zed'; }));
|
||||
$this->assertInstanceOf(Thunder\Shortcode\ShortcodeFacade::class, flextype('parsers')->shortcode()->addHandler('zed', static function() { return 'Zed'; }));
|
||||
$this->assertEquals('Zed', flextype('parsers')->shortcode()->process('[zed]'));
|
||||
$this->assertEquals('fòôBàřZed', flextype('parsers')->shortcode()->process('fòôBàř[zed]'));
|
||||
});
|
||||
|
Reference in New Issue
Block a user