1 | <?php |
||
20 | class ProcedureCompilerTest extends \PHPUnit_Framework_TestCase |
||
21 | { |
||
22 | |||
23 | /** +++++++++++++++++++++++++++++++++++ **/ |
||
24 | /** ++++++++++++++ TESTS ++++++++++++++ **/ |
||
25 | /** +++++++++++++++++++++++++++++++++++ **/ |
||
26 | |||
27 | /** |
||
28 | * Test can compile procedure |
||
29 | * |
||
30 | * @access public |
||
31 | * @return void |
||
32 | */ |
||
33 | public function testCanCompileProcedure() |
||
47 | |||
48 | /** |
||
49 | * Test procedure is loaded from cache |
||
50 | * if cache is enabled. |
||
51 | * |
||
52 | * @access public |
||
53 | * @return void |
||
54 | */ |
||
55 | public function testProcedureIsLoadedFromCacheIfCacheIsEnabled() |
||
81 | |||
82 | /** |
||
83 | * Test procedure is not loaded from |
||
84 | * cache if cache is disabled. |
||
85 | * |
||
86 | * @access public |
||
87 | * @return void |
||
88 | */ |
||
89 | public function testProcedureIsNotLoadedFromCacheIfCacheIsDisabled() |
||
115 | |||
116 | /** |
||
117 | * Test procedure cache can be cleared. |
||
118 | * |
||
119 | * @access public |
||
120 | * @return void |
||
121 | */ |
||
122 | public function testProcedureCacheCanBeCleared() |
||
148 | |||
149 | /** |
||
150 | * Test syntax exception is thrown if compiled |
||
151 | * template is not valid. |
||
152 | * |
||
153 | * @access public |
||
154 | * @return void |
||
155 | */ |
||
156 | public function testSyntaxExceptionIsThrownIfCompiledTemplateIsNotValid() |
||
173 | |||
174 | /** +++++++++++++++++++++++++++++++++++ **/ |
||
175 | /** ++++++++++ TEST ENTITIES ++++++++++ **/ |
||
176 | /** +++++++++++++++++++++++++++++++++++ **/ |
||
177 | |||
178 | /** |
||
179 | * Get procedure compiler. |
||
180 | * |
||
181 | * @access protected |
||
182 | * @return \JonnyW\PhantomJs\Procedure\ProcedureCompiler |
||
183 | */ |
||
184 | protected function getProcedureCompiler() |
||
197 | |||
198 | /** |
||
199 | * getProcedure function. |
||
200 | * |
||
201 | * @access protected |
||
202 | * @param string $id |
||
203 | * @return \JonnyW\PhantomJs\Procedure\ProcedureInterface |
||
204 | */ |
||
205 | protected function getProcedure($id) |
||
209 | |||
210 | /** |
||
211 | * Get request |
||
212 | * |
||
213 | * @access protected |
||
214 | * @return \JonnyW\PhantomJs\Http\Request |
||
215 | */ |
||
216 | protected function getRequest() |
||
222 | |||
223 | /** +++++++++++++++++++++++++++++++ **/ |
||
224 | /** ++++++++++ UTILITIES ++++++++++ **/ |
||
225 | /** +++++++++++++++++++++++++++++++ **/ |
||
226 | |||
227 | /** |
||
228 | * Set up tasks. |
||
229 | * |
||
230 | * @access protected |
||
231 | * @return void |
||
232 | */ |
||
233 | protected function setUp() |
||
239 | |||
240 | /** |
||
241 | * Tear down tasks. |
||
242 | * |
||
243 | * @access protected |
||
244 | * @return void |
||
245 | */ |
||
246 | protected function tearDown() |
||
252 | |||
253 | /** |
||
254 | * Clean up cache files. |
||
255 | * |
||
256 | * @access protected |
||
257 | * @return void |
||
258 | */ |
||
259 | protected function cleanup() |
||
265 | } |
||
266 |
This check looks for a call to a parent method whose name is different than the method from which it is called.
Consider the following code:
The
getFirstName()
method in theSon
calls the wrong method in the parent class.