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
Http
TransferFactoryTest.php
Go to the documentation of this file.
1
<?php
6
namespace
Magento\Braintree\Test\Unit\Gateway\Http
;
7
8
use
Magento\Braintree\Gateway\Http\TransferFactory
;
9
use
Magento\Payment\Gateway\Http\TransferBuilder
;
10
use
Magento\Payment\Gateway\Http\TransferInterface
;
11
15
class
TransferFactoryTest
extends
\PHPUnit\Framework\TestCase
16
{
20
private
$transferFactory;
21
25
private
$transferMock;
26
30
private
$transferBuilder;
31
32
protected
function
setUp
()
33
{
34
$this->transferBuilder = $this->createMock(TransferBuilder::class);
35
$this->transferMock = $this->createMock(TransferInterface::class);
36
37
$this->transferFactory =
new
TransferFactory
(
38
$this->transferBuilder
39
);
40
}
41
42
public
function
testCreate
()
43
{
44
$request
= [
'data1'
,
'data2'
];
45
46
$this->transferBuilder->expects($this->once())
47
->method(
'setBody'
)
48
->with(
$request
)
49
->willReturnSelf();
50
51
$this->transferBuilder->expects($this->once())
52
->method(
'build'
)
53
->willReturn($this->transferMock);
54
55
$this->assertEquals($this->transferMock, $this->transferFactory->create(
$request
));
56
}
57
}
Magento\Braintree\Test\Unit\Gateway\Http\TransferFactoryTest\setUp
setUp()
Definition:
TransferFactoryTest.php:32
Magento\Braintree\Gateway\Http\TransferFactory
Definition:
TransferFactory.php:13
Magento\Payment\Gateway\Http\TransferBuilder
Definition:
TransferBuilder.php:13
Magento\Braintree\Test\Unit\Gateway\Http\TransferFactoryTest
Definition:
TransferFactoryTest.php:15
$request
$request
Definition:
quote_with_configurable_product_last_variation.php:22
Magento\Braintree\Test\Unit\Gateway\Http\TransferFactoryTest\testCreate
testCreate()
Definition:
TransferFactoryTest.php:42
Magento\Payment\Gateway\Http\TransferInterface
Definition:
TransferInterface.php:14
Magento\Braintree\Test\Unit\Gateway\Http