public function testDecoding() { $formatter = new Markdown(); $data = array('name' => 'Joe', 'age' => 21, 'employed' => true, 'body' => "Lorem ipsum dolor\nsit amet"); $raw = file_get_contents(__DIR__ . '/fixtures/joe.md'); $this->assertEquals($data, $formatter->decode($raw)); }
public function testNestedQuote() { $md = <<<TEXT > this is a test quote > > ## some heading > > another text and an reply to this quote TEXT; $actual = Markdown::decode($md); $expect = '<blockquote>' . "\n"; $expect .= '<p>this is a test quote </p>' . "\n"; $expect .= '<h2>some heading</h2>' . "\n"; $expect .= '<p>another text </p>' . "\n"; $expect .= '</blockquote>' . "\n"; $expect .= '<p>and an reply to this quote </p>' . "\n"; $this->assertEquals($expect, $actual); }