Give it what it wants. Replace Mockery::mock('TenantContextInterface'); with Mockery::mock('BRZ\MultiTenant\TenantContextInterface');
Oct 3, 2014
4
Level 5
Mockery error
Hi
I am trying - again - to get a grip on testing. I have started with this test ...
public function testMe()
{
// Arrange
$tenantContext = Mockery::mock('TenantContextInterface');
$tenantContext->shouldReceive('id')->andReturn(99);
$resources = new ResourcesRepo($tenantContext);
// Act
// Assert
}
... and get this error ...
ErrorException: Argument 1 passed to BRZ\Resources\ResourcesMysqlRepository::__construct() must implement interface BRZ\MultiTenant\TenantContextInterface, instance of Mockery_0__TenantContextInterface given, called in /home/vagrant/Code/InterimNew/tests/integration/ResourcesMysqlRepositoryTest.php on line 33 and defined
Any thoughts? Cheers.
Level 13
1 like
Please or to participate in this conversation.