function testRegisterShortcodeUsingClasses()
 {
     $shortcode = new Shortcode();
     $shortcode->register('div', 'HTMLShortcode@div');
     $shortcode->register('img', 'HTMLShortcode@img');
     $exceptedDiv = '<div>Hello</div>';
     $exceptedImg = '<img src="#">';
     $this->assertEquals($exceptedDiv, $shortcode->compile('[div]Hello[/div]'));
     $this->assertEquals($exceptedImg, $shortcode->compile('[img src="#"]'));
 }
示例#2
0
 /**
  * Compile the gived content.
  *
  * @param string $content
  * @return void 
  * @static 
  */
 public static function compile($content)
 {
     \Pingpong\Shortcode\Shortcode::compile($content);
 }