2017年7月11日 星期二

Error when mocking interfaces in PHP using Mockery

You should call mock() method at the and of mock declaration.
$mock = Mockery::mock('MyNamespace\SomeSubFolder\MyInterface');

$mock->shouldReceive('method1')
     ->andReturn('foo')
     ->mock();

from : https://stackoverflow.com/questions/19479052/error-when-mocking-interfaces-in-php-using-mockery

沒有留言:

wibiya widget