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