You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 text was updated successfully, but these errors were encountered:
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 text was updated successfully, but these errors were encountered: