1 | <?php |
||
18 | class EngineTest extends \PHPUnit_Framework_TestCase |
||
19 | { |
||
20 | |||
21 | /** +++++++++++++++++++++++++++++++++++ **/ |
||
22 | /** ++++++++++++++ TESTS ++++++++++++++ **/ |
||
23 | /** +++++++++++++++++++++++++++++++++++ **/ |
||
24 | |||
25 | /** |
||
26 | * Test invalid executable exception is thrown |
||
27 | * if phantom JS path is invalid. |
||
28 | * |
||
29 | * @access public |
||
30 | * @return void |
||
31 | */ |
||
32 | public function testInvalidExecutableExceptionIsThrownIfPhantomJSPathIsInvalid() |
||
39 | |||
40 | /** |
||
41 | * Test default phantom JS path is returned |
||
42 | * if no custom path is set. |
||
43 | * |
||
44 | * @access public |
||
45 | * @return void |
||
46 | */ |
||
47 | public function testDefaultPhantomJSPathIsReturnedIfNoCustomPathIsSet() |
||
53 | |||
54 | /** |
||
55 | * Test can log data. |
||
56 | * |
||
57 | * @access public |
||
58 | * @return void |
||
59 | */ |
||
60 | public function testCanLogData() |
||
69 | |||
70 | /** |
||
71 | * Test can clear log. |
||
72 | * |
||
73 | * @access public |
||
74 | * @return void |
||
75 | */ |
||
76 | public function testCanClearLog() |
||
86 | |||
87 | /** |
||
88 | * Test can add run option. |
||
89 | * |
||
90 | * @access public |
||
91 | * @return void |
||
92 | */ |
||
93 | public function testCanAddRunOption() |
||
108 | |||
109 | /** |
||
110 | * Test invalid executable exception is thrown when |
||
111 | * building command if path to phantom JS is valid. |
||
112 | * |
||
113 | * @access public |
||
114 | * @return void |
||
115 | */ |
||
116 | public function testInvalidExecutableExceptionIsThrownWhenBuildingCommandIfPathToPhantomJSIsInvalid() |
||
128 | |||
129 | /** |
||
130 | * Test command contains phantom JS executable |
||
131 | * |
||
132 | * @access public |
||
133 | * @return void |
||
134 | */ |
||
135 | public function testCommandContainsPhantomJSExecutable() |
||
141 | |||
142 | /** |
||
143 | * Test debug flag can be set. |
||
144 | * |
||
145 | * @access public |
||
146 | * @return void |
||
147 | */ |
||
148 | public function testDebugFlagCanBeSet() |
||
155 | |||
156 | /** |
||
157 | * Test debug flag is not set if |
||
158 | * debugging is not enabled. |
||
159 | * |
||
160 | * @access public |
||
161 | * @return void |
||
162 | */ |
||
163 | public function testDebugFlagIsNotSetIfDebuggingIsNotEnabled() |
||
170 | |||
171 | /** |
||
172 | * Test disk cache flag can be set. |
||
173 | * |
||
174 | * @access public |
||
175 | * @return void |
||
176 | */ |
||
177 | public function testDiskCacheFlagCanBeSet() |
||
184 | |||
185 | /** |
||
186 | * Test disk cache flag is not set if |
||
187 | * caching is not enabled. |
||
188 | * |
||
189 | * @access public |
||
190 | * @return void |
||
191 | */ |
||
192 | public function testDiskCacheFlagIsNotSetIfCachingIsNotEnabled() |
||
199 | |||
200 | /** |
||
201 | * Test command contains run options. |
||
202 | * |
||
203 | * @access public |
||
204 | * @return void |
||
205 | */ |
||
206 | public function testCommandContainsRunOptions() |
||
223 | |||
224 | /** |
||
225 | * Test debug flag is set if runs options |
||
226 | * are also set. |
||
227 | * |
||
228 | * @access public |
||
229 | * @return void |
||
230 | */ |
||
231 | public function testDebugFlagIsSetIfRunOptionsAreAlsoSet() |
||
244 | |||
245 | /** +++++++++++++++++++++++++++++++++++ **/ |
||
246 | /** ++++++++++ TEST ENTITIES ++++++++++ **/ |
||
247 | /** +++++++++++++++++++++++++++++++++++ **/ |
||
248 | |||
249 | /** |
||
250 | * Get client instance |
||
251 | * |
||
252 | * @return \JonnyW\PhantomJs\Engine |
||
253 | */ |
||
254 | protected function getEngine() |
||
260 | } |
||
261 |