Magento Extensions Rating 2024
EXTENSIONS BY CATEGORY
B2B (Business-To-Business)
Blog
Customer
ERP (Enterprise Resource Planning)
Mega Menu
One Step Checkout
Order
POS (Point Of Sale)
Search
Shopping Cart
Sitemap
SEO
Social
Stock & Inventory Management
EXTENSIONS BY DEVELOPER
aheadWorks
Amasty
Boost My Shop
BSS Commerce
Magestore
MageWorx
Mirasvit
Templates Master
Wyomind
XTENTO
Magento 2 Documentation
Magento 2 Documentation
2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
vendor
magento
module-braintree
Test
Unit
Gateway
Response
CancelDetailsHandlerTest.php
Go to the documentation of this file.
1
<?php
6
declare(strict_types=1);
7
8
namespace
Magento\Braintree\Test\Unit\Gateway\Response
;
9
10
use
Magento\Braintree\Gateway\Response\CancelDetailsHandler
;
11
use
Magento\Braintree\Gateway\SubjectReader
;
12
use
Magento\Payment\Gateway\Data\OrderAdapterInterface
;
13
use
Magento\Payment\Gateway\Data\PaymentDataObject
;
14
use
Magento\Sales\Model\Order\Payment
;
15
use PHPUnit\Framework\TestCase;
16
use PHPUnit_Framework_MockObject_MockObject as MockObject;
17
21
class
CancelDetailsHandlerTest
extends
TestCase
22
{
26
private
$handler;
27
31
protected
function
setUp
()
32
{
33
$this->handler =
new
CancelDetailsHandler
(
new
SubjectReader
());
34
}
35
41
public
function
testHandle(): void
42
{
44
$order
= $this->getMockForAbstractClass(OrderAdapterInterface::class);
46
$payment
= $this->getMockBuilder(Payment::class)
47
->disableOriginalConstructor()
48
->setMethods([
'setOrder'
])
49
->getMock();
50
51
$paymentDO =
new
PaymentDataObject
(
$order
,
$payment
);
52
$response
= [
53
'payment'
=> $paymentDO,
54
];
55
56
$this->handler->handle(
$response
, []);
57
58
self::assertTrue(
$payment
->getIsTransactionClosed(),
'The current transaction should be closed.'
);
59
self::assertTrue(
$payment
->getShouldCloseParentTransaction(),
'The parent transaction should be closed.'
);
60
}
61
}
Magento\Payment\Gateway\Data\PaymentDataObject
Definition:
PaymentDataObject.php:10
$response
$response
Definition:
404.php:11
Magento\Braintree\Test\Unit\Gateway\Response\CancelDetailsHandlerTest\setUp
setUp()
Definition:
CancelDetailsHandlerTest.php:31
Magento\Braintree\Test\Unit\Gateway\Response
Definition:
CancelDetailsHandlerTest.php:8
$order
$order
Definition:
order.php:55
Magento\Braintree\Gateway\Response\CancelDetailsHandler
Definition:
CancelDetailsHandler.php:17
Magento\Payment\Gateway\Data\OrderAdapterInterface
Definition:
OrderAdapterInterface.php:13
$payment
$payment
Definition:
order.php:17
Magento\Braintree\Test\Unit\Gateway\Response\CancelDetailsHandlerTest
Definition:
CancelDetailsHandlerTest.php:21
Magento\Sales\Model\Order\Payment
Definition:
RepositoryTest.php:6
Magento\Braintree\Gateway\SubjectReader
Definition:
SubjectReader.php:16