1 | <?php |
||
28 | class ParserTest extends TestCaseAbstract |
||
29 | { |
||
30 | /** |
||
31 | * setUp |
||
32 | * |
||
33 | * @since 3.1.0 |
||
34 | */ |
||
35 | |||
36 | public function setUp() : void |
||
37 | { |
||
38 | parent::setUp(); |
||
39 | $optionArray = $this->getOptionArray(); |
||
40 | $installer = $this->installerFactory(); |
||
41 | $installer->init(); |
||
42 | $installer->rawCreate(); |
||
43 | $installer->insertSettings($optionArray); |
||
44 | $this->installTestDummy(); |
||
45 | } |
||
46 | |||
47 | /** |
||
48 | * tearDown |
||
49 | * |
||
50 | * @since 3.1.0 |
||
51 | */ |
||
52 | |||
53 | public function tearDown() : void |
||
54 | { |
||
55 | $this->_language->init(); |
||
56 | $this->uninstallTestDummy(); |
||
57 | $this->dropDatabase(); |
||
58 | } |
||
59 | |||
60 | /** |
||
61 | * testCode |
||
62 | * |
||
63 | * @since 3.0.0 |
||
64 | * |
||
65 | * @param string $content |
||
66 | * @param string $expect |
||
67 | * |
||
68 | * @dataProvider providerAutoloader |
||
69 | */ |
||
70 | |||
71 | public function testCode(string $content = null, string $expect = null) : void |
||
86 | |||
87 | /** |
||
88 | * testLanguage |
||
89 | * |
||
90 | * @since 3.0.0 |
||
91 | * |
||
92 | * @param string $language |
||
93 | * @param string $content |
||
94 | * @param string $expect |
||
95 | * |
||
96 | * @dataProvider providerAutoloader |
||
97 | */ |
||
98 | |||
99 | public function testLanguage(string $language = null, string $content = null, string $expect = null) : void |
||
100 | { |
||
101 | /* setup */ |
||
102 | |||
103 | $this->_language->init($language); |
||
104 | $parser = new Content\Parser($this->_registry, $this->_request, $this->_language, $this->_config); |
||
105 | $parser->process($content); |
||
106 | |||
107 | /* actual */ |
||
108 | |||
109 | $actual = $parser->getOutput(); |
||
110 | |||
111 | /* compare */ |
||
112 | |||
113 | $this->assertEquals($expect, $actual); |
||
114 | } |
||
115 | |||
116 | /** |
||
117 | * testModule |
||
118 | * |
||
119 | * @since 3.0.0 |
||
120 | * |
||
121 | * @param string $content |
||
122 | * @param string $expect |
||
123 | * |
||
124 | * @dataProvider providerAutoloader |
||
125 | */ |
||
126 | |||
127 | public function testModule(string $content = null, string $expect = null) : void |
||
128 | { |
||
129 | /* setup */ |
||
130 | |||
131 | Module\Hook::construct($this->_registry, $this->_request, $this->_language, $this->_config); |
||
132 | Module\Hook::init(); |
||
133 | $parser = new Content\Parser($this->_registry, $this->_request, $this->_language, $this->_config); |
||
134 | $parser->process($content); |
||
135 | |||
136 | /* actual */ |
||
137 | |||
138 | $actual = $parser->getOutput(); |
||
139 | |||
140 | /* compare */ |
||
141 | |||
142 | $this->assertEquals($expect, $actual); |
||
143 | } |
||
144 | |||
145 | /** |
||
146 | * testMore |
||
147 | * |
||
148 | * @since 3.0.0 |
||
149 | * |
||
150 | * @param array $registryArray |
||
151 | * @param string $content |
||
152 | * @param string $route |
||
153 | * @param string $expect |
||
154 | * |
||
155 | * @dataProvider providerAutoloader |
||
156 | */ |
||
157 | |||
158 | public function testMore(array $registryArray = [], string $content = null, string $route = null, string $expect = null) : void |
||
174 | |||
175 | /** |
||
176 | * testRegistry |
||
177 | * |
||
178 | * @since 3.0.0 |
||
179 | * |
||
180 | * @param array $registryArray |
||
181 | * @param string $content |
||
182 | * @param string $expect |
||
183 | * |
||
184 | * @dataProvider providerAutoloader |
||
185 | */ |
||
186 | |||
187 | public function testRegistry(array $registryArray = [], string $content = null, string $expect = null) : void |
||
203 | |||
204 | /** |
||
205 | * testTemplate |
||
206 | * |
||
207 | * @since 3.0.0 |
||
208 | * |
||
209 | * @param string $content |
||
210 | * @param string $expect |
||
211 | * |
||
212 | * @dataProvider providerAutoloader |
||
213 | */ |
||
214 | |||
215 | public function testTemplate(string $content = null, string $expect = null) : void |
||
230 | } |
||
231 |