@@ 232-244 (lines=13) @@ | ||
229 | $this->assertEquals(array('value1'), $data['iterator']); |
|
230 | } |
|
231 | ||
232 | public function testThatCanTransformObjectWithArrayValue() |
|
233 | { |
|
234 | $transformer = $this->getTransformer(); |
|
235 | $document = $transformer->transform(new POPO(), array('array' => array())); |
|
236 | $data = $document->getData(); |
|
237 | ||
238 | $this->assertEquals( |
|
239 | array( |
|
240 | 'key1' => 'value1', |
|
241 | 'key2' => 'value2', |
|
242 | ), $data['array'] |
|
243 | ); |
|
244 | } |
|
245 | ||
246 | public function testThatCanTransformObjectWithMultiDimensionalArrayValue() |
|
247 | { |
|
@@ 486-498 (lines=13) @@ | ||
483 | ), $data['subWithoutIdentifier']); |
|
484 | } |
|
485 | ||
486 | public function testNestedTransformHandlesSingleObjects() |
|
487 | { |
|
488 | $transformer = $this->getTransformer(); |
|
489 | $document = $transformer->transform(new POPO(), array( |
|
490 | 'upper' => array( |
|
491 | 'type' => 'nested', |
|
492 | 'properties' => array('name' => null) |
|
493 | ) |
|
494 | )); |
|
495 | ||
496 | $data = $document->getData(); |
|
497 | $this->assertEquals('a random name', $data['upper']['name']); |
|
498 | } |
|
499 | ||
500 | public function testNestedTransformReturnsAnEmptyArrayForNullValues() |
|
501 | { |