34 $httpClientFactoryMock = $this->getMockBuilder(\
Magento\Framework\HTTP\ZendClientFactory::class)
35 ->setMethods([
'create'])
36 ->disableOriginalConstructor()
38 $this->_httpClientMock = $this->getMockBuilder(\
Magento\Framework\HTTP\ZendClient::class)->setMethods([])
39 ->disableOriginalConstructor()->getMock();
40 $this->_httpClientMock->expects($this->any())->method(
'setUri')->will($this->returnSelf());
41 $this->_httpClientMock->expects($this->any())->method(
'setConfig')->will($this->returnSelf());
42 $this->_httpClientMock->expects($this->any())->method(
'setMethod')->will($this->returnSelf());
43 $this->_httpClientMock->expects($this->any())->method(
'setParameterPost')->will($this->returnSelf());
44 $this->_httpClientMock->expects($this->any())->method(
'setHeaders')->will($this->returnSelf());
45 $this->_httpClientMock->expects($this->any())->method(
'setUrlEncodeBody')->will($this->returnSelf());
47 $httpClientFactoryMock->expects($this->any())->method(
'create')
48 ->will($this->returnValue($this->_httpClientMock));
50 $mathRandomMock = $this->createMock(\
Magento\Framework\Math\Random::class);
51 $loggerMock = $this->createMock(\
Magento\Payment\Model\Method\Logger::class);
52 $this->gatewayMock =$this->_objectManager->create(
53 \
Magento\Paypal\Model\Payflow\Service\Gateway::class,
55 'httpClientFactory' => $httpClientFactoryMock,
56 'mathRandom' => $mathRandomMock,
57 'logger' => $loggerMock,
60 $this->_model = $this->_objectManager->create(
61 \
Magento\Paypal\Model\Payflowpro::class,
62 [
'gateway' => $this->gatewayMock]
static getObjectManager()