Blame view

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