1 | <?php |
||
55 | class MultipartHydratorTest extends AbstractTest |
||
56 | { |
||
57 | |||
58 | /** |
||
59 | * Tears down the fixture |
||
60 | */ |
||
61 | public function tearDown() |
||
76 | |||
77 | /** |
||
78 | * Test a missing multipart hydrator |
||
79 | * |
||
80 | * @expectedException InvalidArgumentException |
||
81 | * @expectedExceptionCode 1447107537 |
||
82 | */ |
||
83 | public function testMissingMultipartHydrator() |
||
87 | |||
88 | /** |
||
89 | * Test an empty multipart hydrator class |
||
90 | * |
||
91 | * @expectedException InvalidArgumentException |
||
92 | * @expectedExceptionCode 1447107792 |
||
93 | */ |
||
94 | public function testEmptyMultipartHydratorClass() |
||
98 | |||
99 | /** |
||
100 | * Test an invalid multipart hydrator class |
||
101 | * |
||
102 | * @expectedException InvalidArgumentException |
||
103 | * @expectedExceptionCode 1447107792 |
||
104 | */ |
||
105 | public function testInvalidMultipartHydratorClass() |
||
109 | |||
110 | /** |
||
111 | * Test invalid multipart hydrator parameters |
||
112 | * |
||
113 | * @expectedException InvalidArgumentException |
||
114 | * @expectedExceptionCode 1447109790 |
||
115 | */ |
||
116 | public function testInvalidMultipartHydratorParameters() |
||
121 | |||
122 | /** |
||
123 | * Test too few multipart hydrator parameters |
||
124 | * |
||
125 | * @expectedException InvalidArgumentException |
||
126 | * @expectedExceptionCode 1447866302 |
||
127 | */ |
||
128 | public function testTooFewMultipartHydratorParameters() |
||
132 | |||
133 | /** |
||
134 | * Test invalid multipart hydrator occurrences minimum |
||
135 | * |
||
136 | * @expectedException \Apparat\Resource\Domain\Model\Part\InvalidArgumentException |
||
137 | * @expectedExceptionCode 1447021191 |
||
138 | */ |
||
139 | public function testInvalidMultipartHydratorMinimumOccurrences() |
||
143 | |||
144 | /** |
||
145 | * Test invalid multipart hydrator occurrences maximum |
||
146 | * |
||
147 | * @expectedException \Apparat\Resource\Domain\Model\Part\InvalidArgumentException |
||
148 | * @expectedExceptionCode 1447021211 |
||
149 | */ |
||
150 | public function testInvalidMultipartHydratorMaximumOccurrences() |
||
154 | |||
155 | /** |
||
156 | * Test an invalid multipart hydrator class |
||
157 | * |
||
158 | * @expectedException InvalidArgumentException |
||
159 | * @expectedExceptionCode 1447868909 |
||
160 | */ |
||
161 | public function testInvalidMultipartSubhydratorClass() |
||
165 | |||
166 | /** |
||
167 | * Test multipart hydrator |
||
168 | */ |
||
169 | public function testMultipartHydrator() |
||
182 | |||
183 | /** |
||
184 | * Test multipart hydrator name |
||
185 | */ |
||
186 | public function testMultipartHydratorName() |
||
199 | |||
200 | /** |
||
201 | * Test multipart hydrator dehydration with an invalid part |
||
202 | * |
||
203 | * @expectedException InvalidArgumentException |
||
204 | * @expectedExceptionCode 1448107001 |
||
205 | */ |
||
206 | public function testMultipartHydratorDehydrationOfInvalidPart() |
||
223 | |||
224 | /** |
||
225 | * Test multipart hydrator dehydration with an invalid part |
||
226 | * |
||
227 | * @expectedException RuntimeException |
||
228 | * @expectedExceptionCode 1448112964 |
||
229 | */ |
||
230 | public function testMultipartHydratorDehydrationWithInvalidOccurrenceDehydration() |
||
246 | |||
247 | /** |
||
248 | * Test sequence hydration with invalid aggregate class |
||
249 | * |
||
250 | * @expectedException RuntimeException |
||
251 | * @expectedExceptionCode 1447887703 |
||
252 | */ |
||
253 | public function testMultipartHydratorInvalidAggregateClass() |
||
268 | |||
269 | /** |
||
270 | * Test sequence dehydration with empty occurrence |
||
271 | * |
||
272 | * @expectedException \Apparat\Resource\Domain\Model\Hydrator\SkippedOccurrenceDehydrationException |
||
273 | * @expectedExceptionCode 1448108316 |
||
274 | */ |
||
275 | public function testMultipartHydratorSequenceEmptyOccurrence() |
||
290 | |||
291 | /** |
||
292 | * Test sequence dehydration with unknown subhydrator name |
||
293 | * |
||
294 | * @expectedException \Apparat\Resource\Domain\Model\Hydrator\SkippedOccurrenceDehydrationException |
||
295 | * @expectedExceptionCode 1448108444 |
||
296 | */ |
||
297 | public function testMultipartHydratorSequenceInvalidSubhydratorName() |
||
312 | |||
313 | /** |
||
314 | * Test sequence dehydration with invalid part instance |
||
315 | * |
||
316 | * @expectedException \Apparat\Resource\Domain\Model\Hydrator\SkippedOccurrenceDehydrationException |
||
317 | * @expectedExceptionCode 1448108849 |
||
318 | */ |
||
319 | public function testMultipartHydratorSequenceInvalidPartInstance() |
||
334 | |||
335 | /** |
||
336 | * Test sequence part count |
||
337 | */ |
||
338 | public function testMultipartHydratorSequenceCount() |
||
351 | |||
352 | /** |
||
353 | * Test invalid occurrences number |
||
354 | * |
||
355 | * @expectedException OutOfBoundsException |
||
356 | * @expectedExceptionCode 1447976806 |
||
357 | */ |
||
358 | public function testMultipartHydratorSequenceInvalidOccurrenceNumber() |
||
372 | |||
373 | /** |
||
374 | * Test sequence serialization |
||
375 | */ |
||
376 | public function testMultipartHydratorSequenceSerialization() |
||
390 | |||
391 | /** |
||
392 | * Test invalid assignment part identifier |
||
393 | * |
||
394 | * @expectedException InvalidArgumentException |
||
395 | * @expectedExceptionCode 1447364401 |
||
396 | */ |
||
397 | public function testMultipartHydratorSequenceInvalidAssignmentPartIdentifier() |
||
411 | |||
412 | /** |
||
413 | * Test sequence unknown delegate method |
||
414 | * |
||
415 | * @expectedException \Apparat\Resource\Domain\Model\Part\InvalidArgumentException |
||
416 | * @expectedExceptionCode 1448225222 |
||
417 | */ |
||
418 | public function testMultipartHydratorSequenceUnknownMethod() |
||
432 | |||
433 | /** |
||
434 | * Test choice dehydration with empty occurrence |
||
435 | * |
||
436 | * @expectedException \Apparat\Resource\Domain\Model\Hydrator\SkippedOccurrenceDehydrationException |
||
437 | * @expectedExceptionCode 1448108316 |
||
438 | */ |
||
439 | public function testMultipartHydratorChoiceEmptyOccurrence() |
||
454 | |||
455 | /** |
||
456 | * Test choice dehydration with unknown subhydrator name |
||
457 | * |
||
458 | * @expectedException \Apparat\Resource\Domain\Model\Hydrator\SkippedOccurrenceDehydrationException |
||
459 | * @expectedExceptionCode 1448108444 |
||
460 | */ |
||
461 | public function testMultipartHydratorChoiceInvalidSubhydratorName() |
||
476 | |||
477 | /** |
||
478 | * Test choice dehydration with invalid part instance |
||
479 | * |
||
480 | * @expectedException \Apparat\Resource\Domain\Model\Hydrator\SkippedOccurrenceDehydrationException |
||
481 | * @expectedExceptionCode 1448108849 |
||
482 | */ |
||
483 | public function testMultipartHydratorChoiceInvalidPartInstance() |
||
498 | } |
||
499 |