示例#1
0
 public function testMarkdown()
 {
     $h = new Text($this->container);
     $this->assertEquals('<p>Test</p>', $h->markdown('Test'));
     $this->assertEquals('<p>Task #123</p>', $h->markdown('Task #123'));
     $this->assertEquals('<p>Task <a href="?controller=a&amp;action=b&amp;c=d&amp;task_id=123">#123</a></p>', $h->markdown('Task #123', array('controller' => 'a', 'action' => 'b', 'params' => array('c' => 'd'))));
     $this->assertEquals('<p>Check that: <a href="http://stackoverflow.com/questions/1732348/regex-match-open-tags-except-xhtml-self-contained-tags/1732454#1732454">http://stackoverflow.com/questions/1732348/regex-match-open-tags-except-xhtml-self-contained-tags/1732454#1732454</a></p>', $h->markdown('Check that: http://stackoverflow.com/questions/1732348/regex-match-open-tags-except-xhtml-self-contained-tags/1732454#1732454', array('controller' => 'a', 'action' => 'b', 'params' => array('c' => 'd'))));
 }
 public function testMarkdownUserLink()
 {
     $h = new Text($this->container);
     $this->assertEquals('<p>Text <a href="?controller=user&amp;action=profile&amp;user_id=1" class="user-mention-link">@admin</a> @notfound</p>', $h->markdown('Text @admin @notfound'));
 }