@@ 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' => '~') |
|
493 | ) |
|
494 | )); |
|
495 | ||
496 | $data = $document->getData(); |
|
497 | $this->assertEquals('a random name', $data['upper']['name']); |
|
498 | } |
|
499 | ||
500 | public function testNestedTransformReturnsAnEmptyArrayForNullValues() |
|
501 | { |
|
@@ 500-513 (lines=14) @@ | ||
497 | $this->assertEquals('a random name', $data['upper']['name']); |
|
498 | } |
|
499 | ||
500 | public function testNestedTransformReturnsAnEmptyArrayForNullValues() |
|
501 | { |
|
502 | $transformer = $this->getTransformer(); |
|
503 | $document = $transformer->transform(new POPO(), array( |
|
504 | 'nullValue' => array( |
|
505 | 'type' => 'nested', |
|
506 | 'properties' => array() |
|
507 | ) |
|
508 | )); |
|
509 | ||
510 | $data = $document->getData(); |
|
511 | $this->assertInternalType('array', $data['nullValue']); |
|
512 | $this->assertEmpty($data['nullValue']); |
|
513 | } |
|
514 | ||
515 | public function testUnmappedFieldValuesAreNormalisedToStrings() |
|
516 | { |