コード例 #1
0
 /**
  * Setup test entity
  */
 protected function setUp()
 {
     $this->transport = $this->getMockForAbstractClass('Oro\\Bundle\\IntegrationBundle\\Provider\\SOAPTransport', [], '', true, true, true, ['getSoapClient', 'getSleepBetweenAttempt']);
     $this->soapClientMock = $this->getMockBuilder('\\SoapClient')->disableOriginalConstructor()->setMethods(['__soapCall', '__getLastResponseHeaders'])->getMock();
     $this->settings = new ParameterBag();
     $this->transportEntity = $this->getMock('Oro\\Bundle\\IntegrationBundle\\Entity\\Transport');
     $this->transportEntity->expects($this->any())->method('getSettingsBag')->will($this->returnValue($this->settings));
     $this->transport->expects($this->any())->method('getSleepBetweenAttempt')->will($this->returnValue(1));
 }
コード例 #2
0
ファイル: SoapTransportTest.php プロジェクト: dairdr/crm
 protected function setUp()
 {
     $encoder = $this->getMock('Oro\\Bundle\\SecurityBundle\\Encoder\\Mcrypt');
     $encoder->expects($this->any())->method('decryptData')->with($this->encryptedApiKey)->will($this->returnValue($this->decryptedApiKey));
     $this->transport = $this->getMock('OroCRM\\Bundle\\MagentoBundle\\Provider\\Transport\\SoapTransport', ['getSoapClient'], [$encoder]);
     $this->soapClientMock = $this->getMockBuilder('\\SoapClient')->disableOriginalConstructor()->setMethods(['__soapCall'])->getMock();
     $this->settings = new ParameterBag();
     $this->transportEntity = $this->getMock('Oro\\Bundle\\IntegrationBundle\\Entity\\Transport');
     $this->transportEntity->expects($this->any())->method('getSettingsBag')->will($this->returnValue($this->settings));
 }
コード例 #3
0
ファイル: SoapTransportTest.php プロジェクト: antrampa/crm
 protected function setUp()
 {
     $encoder = $this->getMock('Oro\\Bundle\\SecurityBundle\\Encoder\\Mcrypt');
     $encoder->expects($this->any())->method('decryptData')->with($this->encryptedApiKey)->will($this->returnValue($this->decryptedApiKey));
     $wsdlManager = $this->getMockBuilder('OroCRM\\Bundle\\MagentoBundle\\Service\\WsdlManager')->disableOriginalConstructor()->getMock();
     $this->transport = $this->getMock('OroCRM\\Bundle\\MagentoBundle\\Provider\\Transport\\SoapTransport', ['getSoapClient'], [$encoder, $wsdlManager]);
     // Do not attempt to run request several times in Unit test. This leads to sleep and test performance impact
     $this->transport->setMultipleAttemptsEnabled(false);
     $this->soapClientMock = $this->getMockBuilder('\\SoapClient')->disableOriginalConstructor()->getMock();
     $this->settings = new ParameterBag();
     $this->transportEntity = $this->getMock('Oro\\Bundle\\IntegrationBundle\\Entity\\Transport');
     $this->transportEntity->expects($this->any())->method('getSettingsBag')->will($this->returnValue($this->settings));
 }