當前位置: 首頁>>代碼示例>>PHP>>正文


PHP EntityManager::shouldReceive方法代碼示例

本文整理匯總了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();
 }
開發者ID:TransformCore,項目名稱:HayPersistenceApi,代碼行數:7,代碼來源:ServiceTestBase.php

示例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());
 }
開發者ID:TransformCore,項目名稱:HayPersistenceApi,代碼行數:13,代碼來源:DistrictCouncilServiceTest.php

示例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));
 }
開發者ID:TransformCore,項目名稱:HayPersistenceApi,代碼行數:11,代碼來源:AuthorityServiceTest.php

示例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);
 }
開發者ID:Bavragor,項目名稱:eveapi-fetcher-bundle,代碼行數:5,代碼來源:ApiUpdaterTest.php


注:本文中的Doctrine\ORM\EntityManager::shouldReceive方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。