46 líneas
958B

  1. <?php
  2. /**
  3. * @copyright Copyright (c) 2014 Carsten Brandt
  4. * @license https://github.com/cebe/markdown/blob/master/LICENSE
  5. * @link https://github.com/cebe/markdown#readme
  6. */
  7. namespace cebe\markdown\tests;
  8. use cebe\markdown\Markdown;
  9. /**
  10. * Test case for traditional markdown.
  11. *
  12. * @author Carsten Brandt <mail@cebe.cc>
  13. * @group default
  14. */
  15. class MarkdownTest extends BaseMarkdownTest
  16. {
  17. public function createMarkdown()
  18. {
  19. return new Markdown();
  20. }
  21. public function getDataPaths()
  22. {
  23. return [
  24. 'markdown-data' => __DIR__ . '/markdown-data',
  25. ];
  26. }
  27. public function testEdgeCases()
  28. {
  29. $this->assertEquals("<p>&amp;</p>\n", $this->createMarkdown()->parse('&'));
  30. $this->assertEquals("<p>&lt;</p>\n", $this->createMarkdown()->parse('<'));
  31. }
  32. public function testKeepZeroAlive()
  33. {
  34. $parser = $this->createMarkdown();
  35. $this->assertEquals("0", $parser->parseParagraph("0"));
  36. $this->assertEquals("<p>0</p>\n", $parser->parse("0"));
  37. }
  38. }