Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Public Member Functions | Protected Attributes
PayflowproTest Class Reference
Inheritance diagram for PayflowproTest:

Public Member Functions

 setUp ()
 

Protected Attributes

 $_objectManager
 
 $_model
 
 $_httpClientMock
 
 $gatewayMock
 

Detailed Description

Definition at line 9 of file PayflowproTest.php.

Member Function Documentation

◆ setUp()

setUp ( )

Definition at line 31 of file PayflowproTest.php.

32  {
34  $httpClientFactoryMock = $this->getMockBuilder(\Magento\Framework\HTTP\ZendClientFactory::class)
35  ->setMethods(['create'])
36  ->disableOriginalConstructor()
37  ->getMock();
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());
46 
47  $httpClientFactoryMock->expects($this->any())->method('create')
48  ->will($this->returnValue($this->_httpClientMock));
49 
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,
54  [
55  'httpClientFactory' => $httpClientFactoryMock,
56  'mathRandom' => $mathRandomMock,
57  'logger' => $loggerMock,
58  ]
59  );
60  $this->_model = $this->_objectManager->create(
61  \Magento\Paypal\Model\Payflowpro::class,
62  ['gateway' => $this->gatewayMock]
63  );
64  }

Field Documentation

◆ $_httpClientMock

$_httpClientMock
protected

Definition at line 24 of file PayflowproTest.php.

◆ $_model

$_model
protected

Definition at line 19 of file PayflowproTest.php.

◆ $_objectManager

$_objectManager
protected

Definition at line 14 of file PayflowproTest.php.

◆ $gatewayMock

$gatewayMock
protected

Definition at line 29 of file PayflowproTest.php.


The documentation for this class was generated from the following file: