Elasticquent
Elasticquent copied to clipboard
Not able to mock client->search while used complexSearch
Sample code public function searchQuery($params){ return $result = self::complexSearch($params); }
Now to mock this code in unit test, I tried as below. $client = \Mockery::mock(Client::class); $client->shouldReceive('search')->andReturn(['categories']); $this->elasticquentModel->shouldReceive('complexSearch')->andReturn($client);
But not able to mock, as the method is in trait not in class. can anyone help me in mocking the result of complexSearch().
The same for me