public static function addShortcode($tag, $function) { self::$shortcodes[$tag] = $function; }
public function testAddShortcode() { Post::addShortcode('gallery', function (ShortcodeInterface $s) { return $s->getName() . '.' . $s->getParameter('id') . '.' . $s->getParameter('size'); }); $post = Post::find(123); $this->assertEquals($post->content, 'test gallery.123.medium shortcodes'); }