/** * @param array $connectors * @param \DateTime $syncStartDate * @param object|null $realConnector * @return Channel|\PHPUnit_Framework_MockObject_MockObject */ protected function getIntegration(array $connectors = [], \DateTime $syncStartDate = null, $realConnector = null) { $integration = $this->getMockBuilder('Oro\\Bundle\\IntegrationBundle\\Entity\\Channel')->disableOriginalConstructor()->getMock(); $integration->expects($this->any())->method('getConnectors')->will($this->returnValue($connectors)); $integration->expects($this->any())->method('getId')->will($this->returnValue('testChannel')); $integration->expects($this->any())->method('getType')->will($this->returnValue('testChannelType')); $transport = new MagentoSoapTransport(); if ($syncStartDate) { $transport->setSyncStartDate($syncStartDate); } $integration->expects($this->any())->method('getTransport')->will($this->returnValue($transport)); $integration->expects($this->any())->method('isEnabled')->will($this->returnValue(true)); if (!$realConnector) { $realConnector = new TestConnector(); } $this->typesRegistry->expects($this->any())->method('getConnectorType')->will($this->returnValue($realConnector)); return $integration; }