@@ 28-36 (lines=9) @@ | ||
25 | /** |
|
26 | * @dataProvider getYaml |
|
27 | */ |
|
28 | public function testYaml($string, $data, $content, bool $hasFrontMatter) |
|
29 | { |
|
30 | $frontMatter = new FrontMatter(); |
|
31 | $document = $frontMatter->parse($string); |
|
32 | ||
33 | $this->assertSame($hasFrontMatter, $frontMatter->exists($string)); |
|
34 | $this->assertDocument($data, $content, $document); |
|
35 | $this->assertEquals($string, $frontMatter->dump($document)); |
|
36 | } |
|
37 | ||
38 | /** |
|
39 | * @dataProvider getSeparator |
|
@@ 41-49 (lines=9) @@ | ||
38 | /** |
|
39 | * @dataProvider getSeparator |
|
40 | */ |
|
41 | public function testYamlWithCustomSeparator($string, $data, $content, bool $hasFrontMatter) |
|
42 | { |
|
43 | $frontMatter = new FrontMatter(null, '<!--', '-->'); |
|
44 | $document = $frontMatter->parse($string); |
|
45 | ||
46 | $this->assertSame($hasFrontMatter, $frontMatter->exists($string)); |
|
47 | $this->assertDocument($data, $content, $document); |
|
48 | $this->assertEquals($string, $frontMatter->dump($document)); |
|
49 | } |
|
50 | ||
51 | /** |
|
52 | * @dataProvider getJson |
|
@@ 54-62 (lines=9) @@ | ||
51 | /** |
|
52 | * @dataProvider getJson |
|
53 | */ |
|
54 | public function testJson($string, $data, $content, bool $hasFrontMatter) |
|
55 | { |
|
56 | $frontMatter = new FrontMatter(new JsonProcessor()); |
|
57 | $document = $frontMatter->parse($string); |
|
58 | ||
59 | $this->assertSame($hasFrontMatter, $frontMatter->exists($string)); |
|
60 | $this->assertDocument($data, $content, $document); |
|
61 | $this->assertEquals($string, $frontMatter->dump($document)); |
|
62 | } |
|
63 | ||
64 | /** |
|
65 | * @dataProvider getPlainJson |
|
@@ 67-75 (lines=9) @@ | ||
64 | /** |
|
65 | * @dataProvider getPlainJson |
|
66 | */ |
|
67 | public function testPlainJson($string, $data, $content, bool $hasFrontMatter) |
|
68 | { |
|
69 | $frontMatter = new FrontMatter(new JsonWithoutBracesProcessor(), '{', '}'); |
|
70 | $document = $frontMatter->parse($string); |
|
71 | ||
72 | $this->assertSame($hasFrontMatter, $frontMatter->exists($string)); |
|
73 | $this->assertDocument($data, $content, $document); |
|
74 | $this->assertEquals($string, $frontMatter->dump($document)); |
|
75 | } |
|
76 | ||
77 | /** |
|
78 | * @dataProvider getYaml |
|
@@ 80-88 (lines=9) @@ | ||
77 | /** |
|
78 | * @dataProvider getYaml |
|
79 | */ |
|
80 | public function testNeon($string, $data, $content, bool $hasFrontMatter) |
|
81 | { |
|
82 | $frontMatter = new FrontMatter(new NeonProcessor()); |
|
83 | $document = $frontMatter->parse($string); |
|
84 | ||
85 | $this->assertSame($hasFrontMatter, $frontMatter->exists($string)); |
|
86 | $this->assertDocument($data, $content, $document); |
|
87 | $this->assertEquals($string, $frontMatter->dump($document)); |
|
88 | } |
|
89 | ||
90 | /** |
|
91 | * @dataProvider getToml |