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

Public Member Functions

 testCancelAction ()
 
- 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 11 of file HostedproTest.php.

Member Function Documentation

◆ testCancelAction()

testCancelAction ( )

@magentoDataFixture Magento/Paypal/_files/quote_payment_express.php @magentoConfigFixture current_store payment/paypal_hostedpro/active 1 @magentoConfigFixture current_store paypal/general/business_account merch.nosp@m.ant_.nosp@m.20120.nosp@m.5071.nosp@m.8_biz.nosp@m.@exa.nosp@m.mple..nosp@m.com

Definition at line 18 of file HostedproTest.php.

19  {
20  $order = $this->_objectManager->create(\Magento\Sales\Model\Order::class);
21  $session = $this->_objectManager->get(\Magento\Checkout\Model\Session::class);
22 
23  $quote = $this->_objectManager->create(\Magento\Quote\Model\Quote::class);
24  $quote->load('100000002', 'reserved_order_id');
25  $session->setQuoteId($quote->getId());
26  $session->setPaypalStandardQuoteId($quote->getId())->setLastRealOrderId('100000002');
27  $this->dispatch('paypal/hostedpro/cancel');
28 
29  $order->load('100000002', 'increment_id');
30  $this->assertEquals('canceled', $order->getState());
31  $this->assertEquals($session->getQuote()->getGrandTotal(), $quote->getGrandTotal());
32  $this->assertEquals($session->getQuote()->getItemsCount(), $quote->getItemsCount());
33  }
$quote
$order
Definition: order.php:55

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