map() публичный Метод

Map the given results to instances of the given model.
public map ( mixed $results, Model $model ) : Illuminate\Database\Eloquent\Collection
$results mixed
$model Illuminate\Database\Eloquent\Model
Результат Illuminate\Database\Eloquent\Collection
 public function test_map_correctly_maps_results_to_models()
 {
     $client = Mockery::mock('Elasticsearch\\Client');
     $engine = new ElasticsearchEngine($client, 'scout');
     $model = Mockery::mock('Illuminate\\Database\\Eloquent\\Model');
     $model->shouldReceive('getKeyName')->andReturn('id');
     $model->shouldReceive('whereIn')->once()->with('id', ['1'])->andReturn($model);
     $model->shouldReceive('get')->once()->andReturn(Collection::make([new ElasticsearchEngineTestModel()]));
     $results = $engine->map(['hits' => ['total' => '1', 'hits' => [['_id' => '1']]]], $model);
     $this->assertEquals(1, count($results));
 }