/** * @test */ public function it_can_search_for_a_single_document() { /** * * Set * */ $query['index'] = 'my_index'; $query['type'] = 'my_type'; $query['id'] = 'abc'; /** * * Expectation * */ $this->index->shouldReceive('getName')->andReturn('index'); $this->client->shouldReceive('get')->andReturn(['hit']); App::shouldReceive('make')->with('menthol.flexible.response.result', ['hit'])->once()->andReturn('result'); /** * * Assertion * */ $result = $this->proxy->searchById('abc'); $this->assertEquals('result', $result); }