Skip to content

Commit

Permalink
Add another condition to test && Fix indentation
Browse files Browse the repository at this point in the history
  • Loading branch information
tzaoh committed Mar 17, 2016
1 parent 32a1c60 commit d2b6376
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions tests/TestCase/ORM/MarshallerTest.php
Expand Up @@ -850,7 +850,7 @@ public function testBelongsToManyWithMixedData()
}

/**
* Test belongsToMany association with the ForceNewTarget to force saving
* Test belongsToMany association with the ForceNewTarget to force saving
* new records on the target tables with BTM relationships when the primaryKey(s)
* of the target table is specified.
*
Expand All @@ -863,20 +863,24 @@ public function testBelongsToManyWithForceNew()
'body' => 'Fourth Article Body',
'author_id' => 1,
'tags' => [
[
'id' => 3
],
[
'id' => 4,
'name' => 'tag4'
]
]
];

$marshaller = new Marshaller($this->articles);
$article = $marshaller->one($data, [
'associated' => ['Tags'],
'forceNew' => true
]);
$marshaller = new Marshaller($this->articles);
$article = $marshaller->one($data, [
'associated' => ['Tags'],
'forceNew' => true
]);

$this->assertTrue($article->tags[0]->isNew(), 'The tag should be new');
$this->assertFalse($article->tags[0]->isNew(), 'The tag should not be new');
$this->assertTrue($article->tags[1]->isNew(), 'The tag should be new');
}

/**
Expand Down

0 comments on commit d2b6376

Please sign in to comment.