public function testFacadeEvents() { $facade = new ShortcodeFacade(); $facade->addHandler('n', function (ShortcodeInterface $s) { return $s->getName(); }); $facade->addEventHandler(Events::FILTER_SHORTCODES, new FilterRawEventHandler(array('raw'))); $this->assertSame('[raw] [n] [/raw]', $facade->process('[raw] [n] [/raw]')); }
/** * Process the shortcodes * * @param string $content the content * @return string */ public function stripShortcodes($content) { $facade = new ShortcodeFacade(); foreach (self::$shortcodes as $tag => $func) { $facade->addHandler($tag, $func); } return $facade->process($content); }