Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Public Member Functions
PayflowTest Class Reference
Inheritance diagram for PayflowTest:
AbstractController

Public Member Functions

 testCancelPaymentActionIsContentGenerated ()
 
 testReturnurlActionIsContentGenerated ()
 
 testFormActionIsContentGenerated ()
 
- Public Member Functions inherited from AbstractController
 getRequest ()
 
 getResponse ()
 
 assert404NotFound ()
 
 assertHeaderPcre ($headerName, $valueRegex)
 
 assertRedirect (\PHPUnit\Framework\Constraint\Constraint $urlConstraint=null)
 

Additional Inherited Members

- Protected Member Functions inherited from AbstractController
 _getBootstrap ()
 
 setUp ()
 
 tearDown ()
 
 assertPostConditions ()
 
 getMessages ( $messageType=null, $messageManagerClass=\Magento\Framework\Message\Manager::class)
 
- Protected Attributes inherited from AbstractController
 $_runCode = ''
 
 $_runScope = 'store'
 
 $_runOptions = []
 
 $_request
 
 $_response
 
 $_objectManager
 
 $_assertSessionErrors = false
 

Detailed Description

@magentoDataFixture Magento/Sales/_files/order.php

Definition at line 20 of file PayflowTest.php.

Member Function Documentation

◆ testCancelPaymentActionIsContentGenerated()

testCancelPaymentActionIsContentGenerated ( )

Definition at line 78 of file PayflowTest.php.

79  {
80  $this->dispatch('paypal/payflow/cancelpayment');
81  $this->assertContains("goToSuccessPage = ''", $this->getResponse()->getBody());
82  }

◆ testFormActionIsContentGenerated()

testFormActionIsContentGenerated ( )

Definition at line 92 of file PayflowTest.php.

93  {
94  $this->dispatch('paypal/payflow/form');
95  $this->assertContains(
96  '<form id="token_form" method="GET" action="https://payflowlink.paypal.com">',
97  $this->getResponse()->getBody()
98  );
99  // Check P3P header
100  $headerConstraints = [];
101  foreach ($this->getResponse()->getHeaders() as $header) {
102  $headerConstraints[] = new \PHPUnit\Framework\Constraint\IsEqual($header->getFieldName());
103  }
104  $constraint = new \PHPUnit\Framework\Constraint\LogicalOr();
105  $constraint->setConstraints($headerConstraints);
106  $this->assertThat('P3P', $constraint);
107  }

◆ testReturnurlActionIsContentGenerated()

testReturnurlActionIsContentGenerated ( )

Definition at line 84 of file PayflowTest.php.

85  {
86  $checkoutHelper = $this->_objectManager->create(\Magento\Paypal\Helper\Checkout::class);
87  $checkoutHelper->cancelCurrentOrder('test');
88  $this->dispatch('paypal/payflow/returnurl');
89  $this->assertContains("goToSuccessPage = ''", $this->getResponse()->getBody());
90  }

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