/** * @dataProvider commonMarkSpecRegressions */ public function testSpecRegressions($source, $expected) { $parser = new \FluxBB\CommonMark\DocumentParser(); $renderer = new \FluxBB\CommonMark\Renderer(); $tree = $parser->convert($source); $actual = $renderer->render($tree); $this->assertEquals($expected, $actual); }
/** * @expectedException FluxBB\CommonMark\Exception\SyntaxError * @expectedExceptionMessage [link] Unable to find id "id" in Reference-style link at line 3 */ public function testSyntaxErrorPointsRightLineNumber() { $parser = new \FluxBB\CommonMark\DocumentParser(); $markdown = <<<EOL This is a paragraph This is a [paragraph][id]. <pre> preformatted text </pre> EOL; $parser->convert($markdown); }