本文整理匯總了PHP中Doctrine\ORM\EntityManager::shouldReceive方法的典型用法代碼示例。如果您正苦於以下問題:PHP EntityManager::shouldReceive方法的具體用法?PHP EntityManager::shouldReceive怎麽用?PHP EntityManager::shouldReceive使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Doctrine\ORM\EntityManager
的用法示例。
在下文中一共展示了EntityManager::shouldReceive方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: mockEntityManager
protected function mockEntityManager()
{
$this->entityManager = \Mockery::mock('Doctrine\\ORM\\EntityManager')->shouldDeferMissing()->shouldAllowMockingProtectedMethods();
$this->entityManager->shouldReceive('getRepository')->withAnyArgs()->andReturnSelf();
$this->entityManager->shouldReceive('getRepositoryFactory')->withAnyArgs()->andReturnSelf();
$this->mockEntityManagerCommands();
}
示例2: mockEntityManager
protected function mockEntityManager()
{
$this->entityManager = \Mockery::mock('Doctrine\\ORM\\EntityManager')->shouldDeferMissing()->shouldAllowMockingProtectedMethods();
$this->entityManager->shouldReceive('getRepository')->withAnyArgs()->andReturnSelf();
$this->entityManager->shouldReceive('getRepositoryFactory')->withAnyArgs()->andReturnSelf();
$this->entityManager->shouldReceive('findDistrictCouncilByNameAndEntityCode')->once()->andReturn(array((new DistrictCouncil('Code', 'Name'))->setId(22)->setDateCreated($this->expectedDate)));
$this->entityManager->shouldReceive('findDistrictCouncilByNameAndEntityCode')->andReturn(func_get_args());
$this->entityManager->shouldReceive('findOneBy')->once()->andReturn((new DistrictCouncil('Code', 'Name'))->setId(22)->setDateCreated($this->expectedDate));
$this->entityManager->shouldReceive('findOneBy')->once()->andReturn(func_get_args());
$this->entityManager->shouldReceive('persist')->withAnyArgs()->andReturnSelf();
$this->entityManager->shouldReceive('flush')->withAnyArgs()->andReturnSelf();
$this->entityManager->shouldReceive('findDistrictCouncilsByName')->withAnyArgs()->andReturn(array());
}
示例3: mockEntityManager
protected function mockEntityManager()
{
$this->entityManager = \Mockery::mock('Doctrine\\ORM\\EntityManager')->shouldDeferMissing()->shouldAllowMockingProtectedMethods();
$this->entityManager->shouldReceive('getRepository')->withAnyArgs()->andReturnSelf();
$this->entityManager->shouldReceive('getRepositoryFactory')->withAnyArgs()->andReturnSelf();
$this->entityManager->shouldReceive('findOneBy')->once()->withAnyArgs()->andReturn((new Authority())->setCounty(new County('Code', 'Name'))->setLha(new LocalHealthAuthority('Code', 'Name'))->setDistrictCouncil(new DistrictCouncil('Code', 'Name'))->setId(22)->setDateCreated($this->expectedDate));
$this->entityManager->shouldReceive('findOneBy')->withAnyArgs()->once()->andReturn(func_get_args());
$this->entityManager->shouldReceive('persist')->withAnyArgs()->andReturnSelf();
$this->entityManager->shouldReceive('flush')->withAnyArgs()->andReturnSelf();
$this->entityManager->shouldReceive('findByPostCode')->withAnyArgs()->andReturn((new Authority())->setPostcode('AA1 BB3')->setDateCreated($this->expectedDate));
}
示例4: mockApiCallLoad
private function mockApiCallLoad()
{
$this->entityManager->shouldReceive('find')->with('TariochEveapiFetcherBundle:ApiCall', self::API_CALL_ID)->andReturn($this->apiCall);
$this->apiCall->shouldReceive('getOwner')->andReturn(null);
}