public function add($item)
{
$this->items[] = $item;
return $this;
}
public function testContainsIndicatesIfKeyedModelInArray() { $mockModel = m::mock('LMongo\\Eloquent\\Model'); $mockModel->shouldReceive('getKey')->andReturn(1); $c = new Collection(array($mockModel)); $mockModel2 = m::mock('LMongo\\Eloquent\\Model'); $mockModel2->shouldReceive('getKey')->andReturn(2); $c->add($mockModel2); $this->assertTrue($c->contains(1)); $this->assertTrue($c->contains(2)); $this->assertFalse($c->contains(3)); }