GithubMarkdownTest.php 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  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\latex\tests;
  8. use cebe\markdown\latex\GithubMarkdown;
  9. /**
  10. * Test case for the github flavored markdown.
  11. *
  12. * @author Carsten Brandt <mail@cebe.cc>
  13. * @group github
  14. */
  15. class GithubMarkdownTest extends BaseMarkdownLatexTest
  16. {
  17. public function createMarkdown()
  18. {
  19. return new GithubMarkdown();
  20. }
  21. public function getDataPaths()
  22. {
  23. return [
  24. 'markdown-data' => __DIR__ . '/markdown-data',
  25. 'github-data' => __DIR__ . '/github-data',
  26. ];
  27. }
  28. public function testNewlines()
  29. {
  30. $markdown = $this->createMarkdown();
  31. $this->assertEquals("This is text\\\\\nnewline\nnewline.", $markdown->parseParagraph("This is text \nnewline\nnewline."));
  32. $markdown->enableNewlines = true;
  33. $this->assertEquals("This is text\\\\\nnewline\\\\\nnewline.", $markdown->parseParagraph("This is text \nnewline\nnewline."));
  34. $this->assertEquals("This is text\n\nnewline\\\\\nnewline.\n\n", $markdown->parse("This is text\n\nnewline\nnewline."));
  35. }
  36. }