I'm using the padraic/mockery package with Laravel and PHPunit. I'm on PHP 5.4.3.
When trying to create a mock object to test a controller I receive an error:
"BadMethodCallException: Method ... shouldRecieve() is not found on this mock object"
My code is below, I'm following a tutorial pretty closely but can't work out why my mocked object doesn't appear to be instantiating properly.
public function testItWorks()
{
$mocked = m::mock('SearchRepositoryInterface');
App::instance('SearchRepositoryInterface', $mocked);
$mocked->shouldRecieve('test')->once()->andReturn('NOT hitting the db');
$response = $this->call('GET', 'search');
$this->assertTrue($response->isOK());
}
You have a typo.
It is shouldReceive
instead of shouldRecieve