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