Skip to content

Commit

Permalink
Fixing typos
Browse files Browse the repository at this point in the history
  • Loading branch information
lorenzo committed Jun 3, 2014
1 parent 730a80f commit 66ccb46
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions tests/TestCase/ORM/QueryRegressionTest.php
Expand Up @@ -135,7 +135,7 @@ public function testNullableTimeColumn() {
*/
public function testCreateJointData() {
$articles = TableRegistry::get('Articles');
$articles->belongsToMany('Highligths', [
$articles->belongsToMany('Highlights', [
'className' => 'TestApp\Model\Table\TagsTable',
'foreignKey' => 'article_id',
'targetForeignKey' => 'tag_id',
Expand All @@ -144,18 +144,18 @@ public function testCreateJointData() {
$entity = $articles->get(2);
$data = [
'id' => 2,
'highligths' => [
'highlights' => [
[
'name' => 'New Special Tag',
'_joinData' => ['highlighted' => true, 'highlighted_time' => '2014-06-01 10:10:00']
]
]
];
$entity = $articles->patchEntity($entity, $data, ['Highligths' => ['associated' => ['_joinData']]]);
$entity = $articles->patchEntity($entity, $data, ['Highlights' => ['associated' => ['_joinData']]]);
$articles->save($entity);
$entity = $articles->get(2, ['contain' => ['Highligths']]);
$this->assertEquals(4, $entity->highligths[0]->_joinData->tag_id);
$this->assertEquals('2014-06-01', $entity->highligths[0]->_joinData->highlighted_time->format('Y-m-d'));
$entity = $articles->get(2, ['contain' => ['Highlights']]);
$this->assertEquals(4, $entity->highlights[0]->_joinData->tag_id);
$this->assertEquals('2014-06-01', $entity->highlights[0]->_joinData->highlighted_time->format('Y-m-d'));
}

}

0 comments on commit 66ccb46

Please sign in to comment.