コード例 #1
0
 public function testMarkdownParser()
 {
     // Test basic markdown conversion
     $this->assertSame('<strong>dog</strong> <em>cat</em> <a href="src">name</a>', ServiceProvider::markdown('**dog** *cat* [name](src)'));
     // Test array arguments
     $this->assertSame('<strong>huh</strong> <em>12</em> <strong>CD</strong>', ServiceProvider::markdown('**%s** *%d* **%X**', array('huh', '12', 205)));
     // Test variable number of arguments
     $this->assertSame('<strong>huh</strong> <em>12</em> <strong>CD</strong>', ServiceProvider::markdown('**%s** *%d* **%X**', 'huh', '12', 205));
     // Test second array argument overrides other arguments
     $this->assertSame('<strong>huh</strong> <em>12</em> <strong>CD</strong>', ServiceProvider::markdown('**%s** *%d* **%X**', array('huh', '12', 205), 'dog', 'cheese'));
 }