public function testAssociate($test = true) { $thing = $this->testInsert(false); $bar = new Bar(); $bar->bar_name = "sammy"; $thing->associateWith($bar); if ($test) { $this->assertEquals($bar->thing_id, $thing->id); $b = new Bar($bar->id); $b->retrieve(); $this->assertEquals($b->thing_id, $thing->id); } else { return $thing; } }