@@ 411-419 (lines=9) @@ | ||
408 | ); |
|
409 | } |
|
410 | ||
411 | public function testParentMapping() |
|
412 | { |
|
413 | $transformer = $this->getTransformer(); |
|
414 | $document = $transformer->transform(new POPO(), [ |
|
415 | '_parent' => ['type' => 'upper', 'property' => 'upper', 'identifier' => 'id'], |
|
416 | ]); |
|
417 | ||
418 | $this->assertSame('parent', $document->getParent()); |
|
419 | } |
|
420 | ||
421 | public function testParentMappingWithCustomIdentifier() |
|
422 | { |
|
@@ 421-429 (lines=9) @@ | ||
418 | $this->assertSame('parent', $document->getParent()); |
|
419 | } |
|
420 | ||
421 | public function testParentMappingWithCustomIdentifier() |
|
422 | { |
|
423 | $transformer = $this->getTransformer(); |
|
424 | $document = $transformer->transform(new POPO(), [ |
|
425 | '_parent' => ['type' => 'upper', 'property' => 'upper', 'identifier' => 'name'], |
|
426 | ]); |
|
427 | ||
428 | $this->assertSame('a random name', $document->getParent()); |
|
429 | } |
|
430 | ||
431 | public function testParentMappingWithNullProperty() |
|
432 | { |
|
@@ 431-439 (lines=9) @@ | ||
428 | $this->assertSame('a random name', $document->getParent()); |
|
429 | } |
|
430 | ||
431 | public function testParentMappingWithNullProperty() |
|
432 | { |
|
433 | $transformer = $this->getTransformer(); |
|
434 | $document = $transformer->transform(new POPO(), [ |
|
435 | '_parent' => ['type' => 'upper', 'property' => null, 'identifier' => 'id'], |
|
436 | ]); |
|
437 | ||
438 | $this->assertSame('parent', $document->getParent()); |
|
439 | } |
|
440 | ||
441 | public function testParentMappingWithCustomProperty() |
|
442 | { |
|
@@ 441-449 (lines=9) @@ | ||
438 | $this->assertSame('parent', $document->getParent()); |
|
439 | } |
|
440 | ||
441 | public function testParentMappingWithCustomProperty() |
|
442 | { |
|
443 | $transformer = $this->getTransformer(); |
|
444 | $document = $transformer->transform(new POPO(), [ |
|
445 | '_parent' => ['type' => 'upper', 'property' => 'upperAlias', 'identifier' => 'id'], |
|
446 | ]); |
|
447 | ||
448 | $this->assertSame('parent', $document->getParent()); |
|
449 | } |
|
450 | ||
451 | public function testThatMappedObjectsDontNeedAnIdentifierField() |
|
452 | { |