public function testCollectionDictionaryReturnsModelKeys() { $one = m::mock('LMongo\\Eloquent\\Model'); $one->shouldReceive('getKey')->andReturn(1); $two = m::mock('LMongo\\Eloquent\\Model'); $two->shouldReceive('getKey')->andReturn(2); $three = m::mock('LMongo\\Eloquent\\Model'); $three->shouldReceive('getKey')->andReturn(3); $c = new Collection(array($one, $two, $three)); $this->assertEquals(array(1, 2, 3), $c->modelKeys()); }