protected function setUp()
 {
     $this->transportMock = $this->getMock('OroCRM\\Bundle\\MagentoBundle\\Provider\\Transport\\MagentoTransportInterface');
     $this->stepExecutionMock = $this->getMockBuilder('Akeneo\\Bundle\\BatchBundle\\Entity\\StepExecution')->setMethods(['getExecutionContext', 'getJobExecution'])->disableOriginalConstructor()->getMock();
     $this->executionContextMock = $this->getMock('Akeneo\\Bundle\\BatchBundle\\Item\\ExecutionContext');
     $this->jobExecutionMock = $this->getMock('Akeneo\\Bundle\\BatchBundle\\Entity\\JobExecution');
     $this->jobExecutionMock->expects($this->any())->method('getExecutionContext')->will($this->returnValue($this->executionContextMock));
     $this->stepExecutionMock->expects($this->any())->method('getJobExecution')->will($this->returnValue($this->jobExecutionMock));
     $this->managerRegistryMock = $this->getMockBuilder('Doctrine\\Common\\Persistence\\ManagerRegistry')->disableOriginalConstructor()->getMock();
     $this->integrationRepositoryMock = $this->getMockBuilder('Oro\\Bundle\\IntegrationBundle\\Entity\\Repository\\ChannelRepository')->disableOriginalConstructor()->getMock();
     $this->managerRegistryMock->expects($this->any())->method('getRepository')->with('OroIntegrationBundle:Channel')->will($this->returnValue($this->integrationRepositoryMock));
 }
 protected function setUp()
 {
     $this->stepExecutionMock = $this->getMockBuilder('Akeneo\\Bundle\\BatchBundle\\Entity\\StepExecution')->setMethods(['getExecutionContext', 'getJobExecution'])->disableOriginalConstructor()->getMock();
     $jobExecution = $this->getMock('Akeneo\\Bundle\\BatchBundle\\Entity\\JobExecution');
     $jobInstance = $this->getMock('Akeneo\\Bundle\\BatchBundle\\Entity\\JobInstance');
     $jobExecution->expects($this->any())->method('getJobInstance')->will($this->returnValue($jobInstance));
     $this->stepExecutionMock->expects($this->any())->method('getJobExecution')->will($this->returnValue($jobExecution));
     $jobInstance->expects($this->any())->method('getAlias')->will($this->returnValue('alias'));
     $this->transportSettings = $this->getMockForAbstractClass('Oro\\Bundle\\IntegrationBundle\\Entity\\Transport');
     $this->transportMock = $this->getMock('Oro\\Bundle\\IntegrationBundle\\Provider\\TransportInterface');
     $this->transportMock->expects($this->any())->method('getTest');
 }
Example #3
0
 protected function setUp()
 {
     $this->eventDispatcher = $this->getMock('Symfony\\Component\\EventDispatcher\\EventDispatcherInterface');
     $this->fieldHelper = $this->getMockBuilder('Oro\\Bundle\\ImportExportBundle\\Field\\FieldHelper')->disableOriginalConstructor()->getMock();
     $this->fieldHelper->expects($this->any())->method('getIdentityValues')->willReturn([]);
     $this->fieldHelper->expects($this->any())->method('getFields')->willReturn([]);
     $this->databaseHelper = $this->getMockBuilder('Oro\\Bundle\\ImportExportBundle\\Field\\DatabaseHelper')->disableOriginalConstructor()->getMock();
     $this->strategyHelper = $this->getMockBuilder('Oro\\Bundle\\ImportExportBundle\\Strategy\\Import\\ImportStrategyHelper')->disableOriginalConstructor()->getMock();
     $this->defaultOwnerHelper = $this->getMockBuilder('Oro\\Bundle\\IntegrationBundle\\ImportExport\\Helper\\DefaultOwnerHelper')->disableOriginalConstructor()->getMock();
     $this->channelHelper = $this->getMockBuilder('OroCRM\\Bundle\\ChannelBundle\\ImportExport\\Helper\\ChannelHelper')->disableOriginalConstructor()->getMock();
     $this->addressHelper = $this->getMockBuilder('OroCRM\\Bundle\\MagentoBundle\\ImportExport\\Strategy\\StrategyHelper\\AddressImportHelper')->disableOriginalConstructor()->getMock();
     $this->stepExecution = $this->getMockBuilder('Akeneo\\Bundle\\BatchBundle\\Entity\\StepExecution')->disableOriginalConstructor()->getMock();
     $this->jobExecution = $this->getMockBuilder('Akeneo\\Bundle\\BatchBundle\\Entity\\JobExecution')->disableOriginalConstructor()->getMock();
     $this->stepExecution->expects($this->any())->method('getJobExecution')->will($this->returnValue($this->jobExecution));
     $this->logger = new NullLogger();
 }
Example #4
0
 protected function setUp()
 {
     $this->contextRegistry = $this->getMock('Oro\\Bundle\\ImportExportBundle\\Context\\ContextRegistry');
     $this->logger = new LoggerStrategy(new NullLogger());
     $this->contextMediator = $this->getMockBuilder('Oro\\Bundle\\IntegrationBundle\\Provider\\ConnectorContextMediator')->disableOriginalConstructor()->getMock();
     $this->stepExecutionMock = $this->getMockBuilder('Akeneo\\Bundle\\BatchBundle\\Entity\\StepExecution')->disableOriginalConstructor()->getMock();
     $this->context = $this->getMock('Oro\\Bundle\\ImportExportBundle\\Context\\ContextInterface');
     $this->contextRegistry->expects($this->any())->method('getByStepExecution')->will($this->returnValue($this->context));
     $channel = $this->getMock('Oro\\Bundle\\IntegrationBundle\\Entity\\Channel');
     $transportSettings = $this->getMockForAbstractClass('Oro\\Bundle\\IntegrationBundle\\Entity\\Transport');
     $channel->expects($this->any())->method('getTransport')->will($this->returnValue($transportSettings));
     $this->transport = $this->getMock('OroCRM\\Bundle\\MagentoBundle\\Provider\\Transport\\MagentoTransportInterface');
     $this->contextMediator->expects($this->any())->method('getInitializedTransport')->will($this->returnValue($this->transport));
     $this->contextMediator->expects($this->any())->method('getChannel')->will($this->returnValue($channel));
     $this->executionContext = $this->getMock('Akeneo\\Bundle\\BatchBundle\\Item\\ExecutionContext');
     $this->jobExecution = $this->getMock('Akeneo\\Bundle\\BatchBundle\\Entity\\JobExecution');
     $this->jobExecution->expects($this->any())->method('getExecutionContext')->will($this->returnValue($this->executionContext));
     $this->stepExecutionMock->expects($this->once())->method('getJobExecution')->will($this->returnValue($this->jobExecution));
 }