Skip to content

Commit

Permalink
Improving test to show the internal use of union queries in marshaller
Browse files Browse the repository at this point in the history
  • Loading branch information
lorenzo committed Oct 27, 2014
1 parent cb89af6 commit b8eeb55
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions tests/TestCase/ORM/MarshallerTest.php
Expand Up @@ -774,6 +774,7 @@ public function testMergeMultipleAssociations() {
['id' => 2, 'comment' => 'Altered comment 2'],
['id' => 1, 'comment' => 'Altered comment 1'],
['id' => 3, 'comment' => 'Extra comment 3'],
['id' => 4, 'comment' => 'Extra comment 4'],
['comment' => 'Extra comment 2']
]
];
Expand All @@ -797,14 +798,26 @@ public function testMergeMultipleAssociations() {
['comment' => 'Extra comment 3'] + $thirdComment,
$entity->comments[2]->toArray()
);

$forthComment = $this->articles->Comments
->find()
->where(['id' => 4])
->hydrate(false)
->first();

$this->assertEquals(
['comment' => 'Extra comment 1'],
['comment' => 'Extra comment 4'] + $forthComment,
$entity->comments[3]->toArray()
);

$this->assertEquals(
['comment' => 'Extra comment 2'],
['comment' => 'Extra comment 1'],
$entity->comments[4]->toArray()
);
$this->assertEquals(
['comment' => 'Extra comment 2'],
$entity->comments[5]->toArray()
);
}

/**
Expand Down

0 comments on commit b8eeb55

Please sign in to comment.