public function testRSSContainer()
 {
     $GLOBALS['wp_is_feed'] = true;
     $base = '\\s+<div class="codecolorer-container.*?" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F';
     $this->assertRegExp("/{$base};width:435px;\"/", codecolorer_highlight('[cc]$a = 10;[/cc]'));
     $this->assertRegExp("/{$base};width:435px;\"/", codecolorer_highlight('[cc width="40em"]$a = 10;[/cc]'));
     $this->assertRegExp("/{$base};width:40em;\"/", codecolorer_highlight('[cc rss_width="40em"]$a = 10;[/cc]'));
 }
 public function testHighlightWithGeshiTheme()
 {
     $this->shtag = "<span style=\"display:block;background-color:\\#ffff66\">";
     $this->assertRegExp("#hello<br />\n{$this->shtag}world<br />{$this->ehtag}!#", codecolorer_highlight("[cc theme=\"geshi\" highlight=\"2\"]hello\nworld\n![/cc]"));
 }
Esempio n. 3
0
 public function testTextWithCodePhpLanguage()
 {
     $this->assertEquals("\n\n<div class=\"codecolorer-container php default\" style=\"overflow:auto;white-space:nowrap;width:435px;\"><div class=\"php codecolorer\"><span class=\"re0\">\$a</span> <span class=\"sy0\">=</span> <span class=\"nu0\">10</span><span class=\"sy0\">;</span></div></div>\n\n", codecolorer_highlight('[cc lang="php"]$a = 10;[/cc]'));
 }