1 | <?php |
||
16 | final class UtilTest extends TestCase |
||
17 | { |
||
18 | /** |
||
19 | * @test |
||
20 | * @covers ::getExceptionInfo |
||
21 | */ |
||
22 | public function getExceptionInfo() |
||
39 | |||
40 | /** |
||
41 | * @test |
||
42 | * @covers ::raiseException |
||
43 | * @expectedException ErrorException |
||
44 | */ |
||
45 | public function raiseExceptionThrowsErrorException() |
||
51 | |||
52 | /** |
||
53 | * @test |
||
54 | * @covers ::raiseException |
||
55 | */ |
||
56 | public function raiseExceptionSetsExceptionPropertiesCorrectly() |
||
71 | |||
72 | /** |
||
73 | * @test |
||
74 | * @covers ::raiseException |
||
75 | */ |
||
76 | public function raiseExceptionReturnsFalseIfErrorReportingDisabled() |
||
82 | |||
83 | /** |
||
84 | * @test |
||
85 | * @covers ::throwIfNotType |
||
86 | */ |
||
87 | public function throwIfNotTypeBasicSuccess() |
||
93 | |||
94 | /** |
||
95 | * @test |
||
96 | * @covers ::throwIfNotType |
||
97 | * @expectedException InvalidArgumentException |
||
98 | */ |
||
99 | public function throwIfNotTypeStringFailure() |
||
103 | |||
104 | /** |
||
105 | * @test |
||
106 | * @covers ::throwIfNotType |
||
107 | * @expectedException InvalidArgumentException |
||
108 | */ |
||
109 | public function throwIfNotTypeBoolFailure() |
||
113 | |||
114 | /** |
||
115 | * @test |
||
116 | * @covers ::throwIfNotType |
||
117 | * @expectedException InvalidArgumentException |
||
118 | */ |
||
119 | public function throwIfNotTypeNullFailure() |
||
123 | |||
124 | /** |
||
125 | * @test |
||
126 | * @covers ::throwIfNotType |
||
127 | * @expectedException InvalidArgumentException |
||
128 | */ |
||
129 | public function throwIfNotTypeIntFailure() |
||
133 | |||
134 | /** |
||
135 | * @test |
||
136 | * @covers ::throwIfNotType |
||
137 | * @expectedException InvalidArgumentException |
||
138 | */ |
||
139 | public function throwIfNotTypeNotStringTypeArg() |
||
143 | |||
144 | /** |
||
145 | * @test |
||
146 | * @covers ::throwIfNotType |
||
147 | * @expectedException InvalidArgumentException |
||
148 | */ |
||
149 | public function throwIfNotTypeBadFunctionName() |
||
153 | |||
154 | /** |
||
155 | * @test |
||
156 | * @covers ::throwIfNotType |
||
157 | */ |
||
158 | public function throwIfNotTypeAllowNullsSuccess() |
||
164 | |||
165 | /** |
||
166 | * @test |
||
167 | * @covers ::throwIfNotType |
||
168 | * @expectedException InvalidArgumentException |
||
169 | */ |
||
170 | public function throwIfNotTypeWhitespaceFailure() |
||
174 | |||
175 | /** |
||
176 | * @test |
||
177 | * @covers ::ensureNot |
||
178 | */ |
||
179 | public function ensureNotSuccess() |
||
183 | |||
184 | /** |
||
185 | * @test |
||
186 | * @covers ::ensureNot |
||
187 | * @expectedException InvalidArgumentException |
||
188 | */ |
||
189 | public function ensureNotBadArg() |
||
193 | |||
194 | /** |
||
195 | * @test |
||
196 | * @covers ::ensureNot |
||
197 | * @expectedException Exception |
||
198 | */ |
||
199 | public function ensureNotBaseException() |
||
203 | |||
204 | /** |
||
205 | * @test |
||
206 | * @covers ::ensureNot |
||
207 | * @expectedException Exception |
||
208 | * @expectedExceptionMessage bah |
||
209 | */ |
||
210 | public function ensureNotUserMessage() |
||
214 | |||
215 | /** |
||
216 | * @test |
||
217 | * @covers ::ensureNot |
||
218 | * @expectedException Exception |
||
219 | * @expectedExceptionMessage bah |
||
220 | */ |
||
221 | public function ensureNotDynamicException() |
||
225 | |||
226 | /** |
||
227 | * @test |
||
228 | * @covers ::ensureNot |
||
229 | * @expectedException \TraderInteractive\HttpException |
||
230 | * @expectedExceptionMessage bah |
||
231 | * @expectedExceptionCode 404 |
||
232 | */ |
||
233 | public function ensureNotDynamicExceptionWithAlias() |
||
237 | |||
238 | /** |
||
239 | * @test |
||
240 | * @covers ::ensureNot |
||
241 | * @expectedException Exception |
||
242 | * @expectedExceptionMessage foo |
||
243 | * @expectedExceptionCode 2 |
||
244 | */ |
||
245 | public function ensureNotException() |
||
249 | |||
250 | /** |
||
251 | * @test |
||
252 | * @covers ::ensure |
||
253 | */ |
||
254 | public function ensureSuccess() |
||
258 | |||
259 | /** |
||
260 | * @test |
||
261 | * @covers ::ensure |
||
262 | * @expectedException InvalidArgumentException |
||
263 | */ |
||
264 | public function ensureBadArg() |
||
268 | |||
269 | /** |
||
270 | * @test |
||
271 | * @covers ::ensure |
||
272 | * @expectedException Exception |
||
273 | */ |
||
274 | public function ensureBaseException() |
||
278 | |||
279 | /** |
||
280 | * @test |
||
281 | * @covers ::ensure |
||
282 | * @expectedException Exception |
||
283 | * @expectedExceptionMessage bah |
||
284 | */ |
||
285 | public function ensureUserMessage() |
||
289 | |||
290 | /** |
||
291 | * @test |
||
292 | * @covers ::ensure |
||
293 | * @expectedException Exception |
||
294 | * @expectedExceptionMessage bah |
||
295 | */ |
||
296 | public function ensureDynamicException() |
||
300 | |||
301 | /** |
||
302 | * @test |
||
303 | * @covers ::ensure |
||
304 | * @expectedException \TraderInteractive\HttpException |
||
305 | * @expectedExceptionMessage bah |
||
306 | * @expectedExceptionCode 404 |
||
307 | */ |
||
308 | public function ensureDynamicExceptionWithAlias() |
||
312 | |||
313 | /** |
||
314 | * @test |
||
315 | * @covers ::ensure |
||
316 | * @expectedException Exception |
||
317 | * @expectedExceptionMessage foo |
||
318 | * @expectedExceptionCode 2 |
||
319 | */ |
||
320 | public function ensureException() |
||
324 | |||
325 | /** |
||
326 | * @test |
||
327 | * @covers ::setExceptionAliases |
||
328 | * @covers ::getExceptionAliases |
||
329 | */ |
||
330 | public function setExceptionAliasesGetSet() |
||
336 | } |
||
337 |