コード例 #1
0
 public function setUp()
 {
     $this->contextAccessor = $this->getMock('Oro\\Bundle\\WorkflowBundle\\Model\\ContextAccessor');
     $this->mailboxProcessStorage = $this->getMockBuilder('Oro\\Bundle\\EmailBundle\\Mailbox\\MailboxProcessStorage')->disableOriginalConstructor()->getMock();
     $demoProcess = $this->getMock('Oro\\Bundle\\EmailBundle\\Mailbox\\MailboxProcessProviderInterface');
     $demoProcess->expects($this->any())->method('getSettingsEntityFQCN')->will($this->returnValue('DemoProcessSettings'));
     $this->mailboxProcessStorage->expects($this->any())->method('getProcess')->with($this->equalTo('demo'))->will($this->returnValue($demoProcess));
     $this->registry = $this->getMockBuilder('Doctrine\\Bundle\\DoctrineBundle\\Registry')->disableOriginalConstructor()->getMock();
     $this->repository = $this->getMockBuilder('Oro\\Bundle\\EmailBundle\\Entity\\Repository\\MailboxRepository')->disableOriginalConstructor()->getMock();
     $this->registry->expects($this->any())->method('getRepository')->with($this->equalTo('OroEmailBundle:Mailbox'))->will($this->returnValue($this->repository));
     $this->action = new RequestMailboxes($this->contextAccessor, $this->registry, $this->mailboxProcessStorage);
     $this->action->setDispatcher($this->getMock('Symfony\\Component\\EventDispatcher\\EventDispatcherInterface'));
 }