Example #1
0
 public function testAssignChildrenManyToManyNonSubtractive()
 {
     $originalChildIds = $this->parentsTable->getChildren('friends', 2)->fetchColumn('friend_id');
     $assignedChildIds = array(4, 5);
     $this->parentsTable->assignChildren('friends', 2, $assignedChildIds, false);
     $newChildIds = $this->parentsTable->getChildren('friends', 2)->fetchColumn('friend_id');
     $combinedIds = array_unique(array_merge($originalChildIds, $assignedChildIds));
     sort($combinedIds);
     sort($newChildIds);
     $this->assertEquals($combinedIds, $newChildIds);
 }