dev-master
9999999-devA markdown test suite
MIT
The Requires
by Kazuyuki Hayashi
by Karl Dubost
test markdown suite
Wallogit.com
2017 © Pedro Peláez
A markdown test suite
After starting the W3C Community Group about Markdown, a question has been raised a few times about a test suite for the markdown syntax., (*2)
I decided to put together a list of individual files isolating some constructs of the markdown syntax. Some features might be missing, you know the deal. Pull Requests are welcome., (*3)
``` php <?php, (*4)
class MarkdownTest extends PHPUnit_Framework_TestCase { public function testParser() { $parser = new YourParser();, (*5)
// test suite based on karlcow/markdown-testsuite
$tests = new KzykHys\MarkdownTestSuite\Tests();
foreach ($tests as $pattern) {
$this->assertEquals(
$pattern->getOutput(), // expected
$parser->parse($pattern->getMarkdown()), // actual
$pattern->getName() . ' failed' // message
);
}
}
public function testYourPatterns()
{
$parser = new YourParser();
// {name}.md for input and {name}.out for output
$tests = new KzykHys\MarkdownTestSuite\Tests('/path/to/patterns');
foreach ($tests as $pattern) {
$this->assertEquals(
$pattern->getOutput(), // expected
$parser->parse($pattern->getMarkdown()), // actual
$pattern->getName() . ' failed' // message
);
}
}
}, (*6)
composer.json example ``` json { "require-dev": { "kzykhys/markdown-testsuite": "dev-master" } }
A markdown test suite
MIT
test markdown suite