These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
1 | <?php |
||
2 | namespace Redaxscript\Tests\Content; |
||
3 | |||
4 | use Redaxscript\Content; |
||
5 | use Redaxscript\Module; |
||
6 | use Redaxscript\Tests\TestCaseAbstract; |
||
7 | |||
8 | /** |
||
9 | * ParserTest |
||
10 | * |
||
11 | * @since 2.1.0 |
||
12 | * |
||
13 | * @package Redaxscript |
||
14 | * @category Tests |
||
15 | * @author Henry Ruhs |
||
16 | * |
||
17 | * @covers Redaxscript\Content\Parser |
||
18 | * @covers Redaxscript\Content\ParserAbstract |
||
19 | * @covers Redaxscript\Content\Tag\Code |
||
20 | * @covers Redaxscript\Content\Tag\Language |
||
21 | * @covers Redaxscript\Content\Tag\Module |
||
22 | * @covers Redaxscript\Content\Tag\More |
||
23 | * @covers Redaxscript\Content\Tag\Registry |
||
24 | * @covers Redaxscript\Content\Tag\TagAbstract |
||
25 | * @covers Redaxscript\Content\Tag\Template |
||
26 | */ |
||
27 | |||
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(); |
||
0 ignored issues
–
show
|
|||
40 | $installer = $this->installerFactory(); |
||
0 ignored issues
–
show
The method
installerFactory() does not seem to exist on object<Redaxscript\Tests\Content\ParserTest> .
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces. This is most likely a typographical error or the method has been renamed.
Loading history...
|
|||
41 | $installer->init(); |
||
42 | $installer->rawCreate(); |
||
43 | $installer->insertSettings($optionArray); |
||
44 | $this->installTestDummy(); |
||
0 ignored issues
–
show
The method
installTestDummy() does not seem to exist on object<Redaxscript\Tests\Content\ParserTest> .
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces. This is most likely a typographical error or the method has been renamed.
Loading history...
|
|||
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(); |
||
0 ignored issues
–
show
The method
uninstallTestDummy() does not seem to exist on object<Redaxscript\Tests\Content\ParserTest> .
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces. This is most likely a typographical error or the method has been renamed.
Loading history...
|
|||
57 | $this->dropDatabase(); |
||
0 ignored issues
–
show
The method
dropDatabase() does not seem to exist on object<Redaxscript\Tests\Content\ParserTest> .
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces. This is most likely a typographical error or the method has been renamed.
Loading history...
|
|||
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 |
||
72 | { |
||
73 | /* setup */ |
||
74 | |||
75 | $parser = new Content\Parser($this->_registry, $this->_request, $this->_language, $this->_config); |
||
76 | $parser->process($content); |
||
77 | |||
78 | /* actual */ |
||
79 | |||
80 | $actual = $parser->getOutput(); |
||
81 | |||
82 | /* compare */ |
||
83 | |||
84 | $this->assertEquals($expect, $actual); |
||
85 | } |
||
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 |
||
159 | { |
||
160 | /* setup */ |
||
161 | |||
162 | $this->_registry->init($registryArray); |
||
163 | $parser = new Content\Parser($this->_registry, $this->_request, $this->_language, $this->_config); |
||
164 | $parser->process($content, $route); |
||
165 | |||
166 | /* actual */ |
||
167 | |||
168 | $actual = $parser->getOutput(); |
||
169 | |||
170 | /* compare */ |
||
171 | |||
172 | $this->assertEquals($expect, $actual); |
||
173 | } |
||
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 |
||
188 | { |
||
189 | /* setup */ |
||
190 | |||
191 | $this->_registry->init($registryArray); |
||
192 | $parser = new Content\Parser($this->_registry, $this->_request, $this->_language, $this->_config); |
||
193 | $parser->process($content); |
||
194 | |||
195 | /* actual */ |
||
196 | |||
197 | $actual = $parser->getOutput(); |
||
198 | |||
199 | /* compare */ |
||
200 | |||
201 | $this->assertEquals($expect, $actual); |
||
202 | } |
||
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 |
||
216 | { |
||
217 | /* setup */ |
||
218 | |||
219 | $parser = new Content\Parser($this->_registry, $this->_request, $this->_language, $this->_config); |
||
220 | $parser->process($content); |
||
221 | |||
222 | /* actual */ |
||
223 | |||
224 | $actual = $parser->getOutput(); |
||
225 | |||
226 | /* compare */ |
||
227 | |||
228 | $this->assertEquals($expect, $actual); |
||
229 | } |
||
230 | } |
||
231 |
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.
This is most likely a typographical error or the method has been renamed.