Skip to content
Permalink
Browse files

Update tests for joinData marshalling.

You have to include the joinData as part of the associated data for it
to be marshalled.
  • Loading branch information...
markstory committed Dec 24, 2013
1 parent 3b46044 commit bed677c4051fc94b4fb1443899ef0395de8c1730
Showing with 15 additions and 3 deletions.
  1. +15 −3 Cake/Test/TestCase/ORM/MarshallerTest.php
@@ -243,7 +243,11 @@ public function testOneBelongsToManyJoinData() {
],
];
$marshall = new Marshaller($this->articles);
$result = $marshall->one($data, ['Tags']);
$result = $marshall->one($data, [
'Tags' => [
'associated' => ['_joinData']
]
]);
$this->assertEquals($data['title'], $result->title);
$this->assertEquals($data['body'], $result->body);
@@ -252,8 +256,16 @@ public function testOneBelongsToManyJoinData() {
$this->assertInstanceOf('Cake\ORM\Entity', $result->tags[0]);
$this->assertEquals($data['tags'][0]['tag'], $result->tags[0]->tag);
$this->assertInstanceOf('Cake\ORM\Entity', $result->tags[0]->_joinData);
$this->assertEquals($data['tags'][0]['_joinData']['active'], $result->tags[0]->_joinData->active);
$this->assertInstanceOf(
'Cake\ORM\Entity',
$result->tags[0]->_joinData,
'_joinData should be an entity.'
);
$this->assertEquals(
$data['tags'][0]['_joinData']['active'],
$result->tags[0]->_joinData->active,
'_joinData should be an entity.'
);
}
/**

0 comments on commit bed677c

Please sign in to comment.
You can’t perform that action at this time.