本文整理汇总了PHP中Oro\Bundle\EntityConfigBundle\DependencyInjection\Utils\ServiceLink::expects方法的典型用法代码示例。如果您正苦于以下问题:PHP ServiceLink::expects方法的具体用法?PHP ServiceLink::expects怎么用?PHP ServiceLink::expects使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Oro\Bundle\EntityConfigBundle\DependencyInjection\Utils\ServiceLink
的用法示例。
在下文中一共展示了ServiceLink::expects方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setUp
/**
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
*/
protected function setUp()
{
$this->em = $this->getMockBuilder('Doctrine\\ORM\\EntityManager')->disableOriginalConstructor()->getMock();
$this->doctrineHelper = $this->getMockBuilder('Oro\\Bundle\\EntityBundle\\ORM\\DoctrineHelper')->disableOriginalConstructor()->getMock();
$this->mailer = $this->getMockBuilder('Oro\\Bundle\\EmailBundle\\Mailer\\DirectMailer')->disableOriginalConstructor()->getMock();
$this->mailerTransport = $this->getMockBuilder('\\Swift_Transport_EsmtpTransport')->disableOriginalConstructor()->getMock();
$this->mailer->expects($this->any())->method('getTransport')->will($this->returnValue($this->mailerTransport));
$this->emailEntityBuilder = $this->getMockBuilder('Oro\\Bundle\\EmailBundle\\Builder\\EmailEntityBuilder')->disableOriginalConstructor()->getMock();
$this->emailOwnerProvider = $this->getMockBuilder('Oro\\Bundle\\EmailBundle\\Entity\\Provider\\EmailOwnerProvider')->disableOriginalConstructor()->getMock();
$this->dispatcher = $this->getMockBuilder('Symfony\\Component\\EventDispatcher\\EventDispatcherInterface')->disableOriginalConstructor()->getMock();
$this->emailActivityManager = $this->getMockBuilder('Oro\\Bundle\\EmailBundle\\Entity\\Manager\\EmailActivityManager')->disableOriginalConstructor()->getMock();
$this->securityFacade = $this->getMockBuilder('Oro\\Bundle\\SecurityBundle\\SecurityFacade')->setMethods(['getLoggedUser', 'getOrganization'])->disableOriginalConstructor()->getMock();
$this->userEmailOrigin = $this->getMockBuilder('Oro\\Bundle\\ImapBundle\\Entity\\UserEmailOrigin')->disableOriginalConstructor()->getMock();
$this->userEmailOrigin->expects($this->any())->method('getSmtpHost')->will($this->returnValue('abc'));
$this->userEmailOrigin->expects($this->any())->method('getSmtpPort')->will($this->returnValue(25));
$this->securityFacadeLink = $this->getMockBuilder('Oro\\Bundle\\EntityConfigBundle\\DependencyInjection\\Utils\\ServiceLink')->setMethods(['getService'])->disableOriginalConstructor()->getMock();
$this->securityFacadeLink->expects($this->any())->method('getService')->will($this->returnValue($this->securityFacade));
$this->securityFacade->expects($this->any())->method('getOrganization')->will($this->returnValue($this->getTestOrganization()));
$this->doctrineHelper->expects($this->any())->method('getEntityManager')->with('OroEmailBundle:Email')->will($this->returnValue($this->em));
$folder = $this->getMockBuilder('Oro\\Bundle\\EmailBundle\\Entity\\EmailFolder')->disableOriginalConstructor()->getMock();
$this->userEmailOrigin->expects($this->any())->method('getFolder')->with(FolderType::SENT)->will($this->returnValue($folder));
$emailOriginRepo = $this->getMockBuilder('Doctrine\\ORM\\EntityRepository')->disableOriginalConstructor()->getMock();
$emailOriginRepo->expects($this->any())->method('findOneBy')->with(['internalName' => InternalEmailOrigin::BAP])->will($this->returnValue($this->userEmailOrigin));
$this->em->expects($this->any())->method('getRepository')->with('OroEmailBundle:InternalEmailOrigin')->will($this->returnValue($emailOriginRepo));
$this->emailProcessor = new Processor($this->doctrineHelper, $this->mailer, new EmailAddressHelper(), $this->emailEntityBuilder, $this->emailOwnerProvider, $this->emailActivityManager, $this->securityFacadeLink, $this->dispatcher, new Mcrypt());
}
示例2: setUp
protected function setUp()
{
$this->service = $this->getMockBuilder('Symfony\\Component\\Security\\Core\\SecurityContext')->disableOriginalConstructor()->getMock();
$this->securityContextLink = $this->getMockBuilder('Oro\\Bundle\\EntityConfigBundle\\DependencyInjection\\Utils\\ServiceLink')->disableOriginalConstructor()->getMock();
$this->securityContextLink->expects($this->any())->method('getService')->willReturn($this->service);
$this->flashBag = $this->getMock('Symfony\\Component\\HttpFoundation\\Session\\Flash\\FlashBagInterface');
$this->userChecker = new UserChecker($this->securityContextLink, $this->flashBag);
}
示例3: setUp
public function setUp()
{
$this->configProvider = $this->getMockBuilder('Oro\\Bundle\\EntityConfigBundle\\Provider\\ConfigProvider')->disableOriginalConstructor()->getMock();
$this->emailAttachmentManager = $this->getMockBuilder('Oro\\Bundle\\EmailBundle\\Manager\\EmailAttachmentManager')->disableOriginalConstructor()->getMock();
$this->activityListProvider = $this->getMockBuilder('Oro\\Bundle\\EmailBundle\\Provider\\EmailActivityListProvider')->disableOriginalConstructor()->getMock();
$this->securityFacadeLink = $this->getMockBuilder('Oro\\Bundle\\EntityConfigBundle\\DependencyInjection\\Utils\\ServiceLink')->disableOriginalConstructor()->getMock();
$this->securityFacade = $this->getMockBuilder('Oro\\Bundle\\SecurityBundle\\SecurityFacade')->disableOriginalConstructor()->getMock();
$this->securityFacadeLink->expects($this->once())->method('getService')->willReturn($this->securityFacade);
$this->chainProvider = $this->getMockBuilder('Oro\\Bundle\\ActivityListBundle\\Provider\\ActivityListChainProvider')->disableOriginalConstructor()->getMock();
$this->entityManager = $this->getMockBuilder('Doctrine\\ORM\\EntityManager')->disableOriginalConstructor()->getMock();
$this->listener = new EmailBodyAddListener($this->emailAttachmentManager, $this->configProvider, $this->activityListProvider, $this->securityFacadeLink, $this->chainProvider, $this->entityManager);
}
示例4: setUp
protected function setUp()
{
$this->em = $this->getMockBuilder('Doctrine\\ORM\\EntityManager')->disableOriginalConstructor()->getMock();
$this->doctrineHelper = $this->getMockBuilder('Oro\\Bundle\\EntityBundle\\ORM\\DoctrineHelper')->disableOriginalConstructor()->getMock();
$this->mailer = $this->getMockBuilder('\\Swift_Mailer')->disableOriginalConstructor()->getMock();
$this->emailEntityBuilder = $this->getMockBuilder('Oro\\Bundle\\EmailBundle\\Builder\\EmailEntityBuilder')->disableOriginalConstructor()->getMock();
$this->emailOwnerProvider = $this->getMockBuilder('Oro\\Bundle\\EmailBundle\\Entity\\Provider\\EmailOwnerProvider')->disableOriginalConstructor()->getMock();
$this->dispatcher = $this->getMockBuilder('Symfony\\Component\\EventDispatcher\\EventDispatcherInterface')->disableOriginalConstructor()->getMock();
$this->emailActivityManager = $this->getMockBuilder('Oro\\Bundle\\EmailBundle\\Entity\\Manager\\EmailActivityManager')->disableOriginalConstructor()->getMock();
$this->securityFacade = $this->getMockBuilder('Oro\\Bundle\\SecurityBundle\\SecurityFacade')->setMethods(['getLoggedUser', 'getOrganization'])->disableOriginalConstructor()->getMock();
$this->securityFacadeLink = $this->getMockBuilder('Oro\\Bundle\\EntityConfigBundle\\DependencyInjection\\Utils\\ServiceLink')->setMethods(['getService'])->disableOriginalConstructor()->getMock();
$this->securityFacadeLink->expects($this->any())->method('getService')->will($this->returnValue($this->securityFacade));
$this->securityFacade->expects($this->any())->method('getOrganization')->will($this->returnValue($this->getTestOrganization()));
$this->doctrineHelper->expects($this->any())->method('getEntityManager')->with('OroEmailBundle:Email')->will($this->returnValue($this->em));
$this->emailProcessor = new Processor($this->doctrineHelper, $this->mailer, new EmailAddressHelper(), $this->emailEntityBuilder, $this->emailOwnerProvider, $this->emailActivityManager, $this->securityFacadeLink, $this->dispatcher);
}
示例5: setUp
protected function setUp()
{
$this->emailCacheManager = $this->getMockBuilder('Oro\\Bundle\\EmailBundle\\Cache\\EmailCacheManager')->disableOriginalConstructor()->getMock();
$filesystemMap = $this->getMockBuilder('Knp\\Bundle\\GaufretteBundle\\FilesystemMap')->disableOriginalConstructor()->getMock();
$this->filesystem = $this->getMockBuilder('Gaufrette\\Filesystem')->setMethods(['delete', 'write', 'has'])->disableOriginalConstructor()->getMock();
$filesystemMap->expects($this->once())->method('get')->with('attachments')->will($this->returnValue($this->filesystem));
$this->registry = $this->getMockBuilder('Doctrine\\Bundle\\DoctrineBundle\\Registry')->disableOriginalConstructor()->getMock();
$this->configFileValidator = $this->getMockBuilder('Oro\\Bundle\\AttachmentBundle\\Validator\\ConfigFileValidator')->disableOriginalConstructor()->getMock();
$this->kernel = $this->getMock('Symfony\\Component\\HttpKernel\\KernelInterface');
$this->kernel->expects($this->once())->method('getRootDir')->willReturn('');
$this->om = $this->getMockBuilder('Doctrine\\Common\\Persistence\\ObjectManager')->disableOriginalConstructor()->getMock();
$this->registry->expects($this->any())->method('getManager')->will($this->returnValue($this->om));
$this->securityFacade = $this->getMockBuilder('Oro\\Bundle\\SecurityBundle\\SecurityFacade')->setMethods(['getLoggedUser'])->disableOriginalConstructor()->getMock();
$this->securityFacadeLink = $this->getMockBuilder('Oro\\Bundle\\EntityConfigBundle\\DependencyInjection\\Utils\\ServiceLink')->setMethods(['getService'])->disableOriginalConstructor()->getMock();
$this->securityFacadeLink->expects($this->any())->method('getService')->will($this->returnValue($this->securityFacade));
$this->em = $this->getMockBuilder('Doctrine\\ORM\\EntityManager')->disableOriginalConstructor()->getMock();
$this->attachment = $this->getMockBuilder('Oro\\Bundle\\AttachmentBundle\\Entity\\Attachment')->setMethods(['supportTarget'])->disableOriginalConstructor()->getMock();
$this->attachmentConfig = $this->getMockBuilder('Oro\\Bundle\\AttachmentBundle\\EntityConfig\\AttachmentConfig')->disableOriginalConstructor()->getMock();
$this->emailAttachmentManager = $this->getMockBuilder('Oro\\Bundle\\EmailBundle\\Manager\\EmailAttachmentManager')->setMethods(['getAttachmentFullPath', 'buildAttachmentInstance'])->setConstructorArgs([$filesystemMap, $this->em, $this->kernel, $this->securityFacadeLink, $this->configFileValidator, $this->attachmentConfig])->getMock();
$this->emailAttachmentManager->expects($this->any())->method('getAttachmentFullPath')->willReturn(__DIR__ . '/../Fixtures/attachment/test.txt');
}
示例6: setUp
protected function setUp()
{
$this->pm = $this->getMockBuilder('Oro\\Bundle\\DistributionBundle\\Manager\\PackageManager')->disableOriginalConstructor()->getMock();
$this->pml = $this->getMockBuilder('Oro\\Bundle\\EntityConfigBundle\\DependencyInjection\\Utils\\ServiceLink')->disableOriginalConstructor()->getMock();
$this->pml->expects($this->any())->method('getService')->will($this->returnValue($this->pm));
}