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-payment
Test
Unit
Gateway
Config
ConfigValueHandlerTest.php
Go to the documentation of this file.
1
<?php
6
namespace
Magento\Payment\Test\Unit\Gateway\Config
;
7
8
use
Magento\Payment\Gateway\ConfigInterface
;
9
use
Magento\Payment\Gateway\Config\ConfigValueHandler
;
10
14
class
ConfigValueHandlerTest
extends
\PHPUnit\Framework\TestCase
15
{
17
protected
$model
;
18
22
protected
$configMock
;
23
24
protected
function
setUp
()
25
{
26
$this->configMock = $this->getMockBuilder(\
Magento
\Payment\Gateway\ConfigInterface::class)
27
->getMockForAbstractClass();
28
$this->model =
new
ConfigValueHandler
($this->configMock);
29
}
30
31
public
function
testHandle
()
32
{
33
$field =
'field'
;
34
$storeId
= 1;
35
$expected =
'some value'
;
36
37
$this->configMock->expects($this->once())
38
->method(
'getValue'
)
39
->with($field,
$storeId
)
40
->willReturn($expected);
41
42
$this->assertEquals($expected, $this->model->handle([
'field'
=> $field],
$storeId
));
43
}
44
45
public
function
testHandleWithoutStoreId
()
46
{
47
$field =
'field'
;
48
$expected =
'some value'
;
49
50
$this->configMock->expects($this->once())
51
->method(
'getValue'
)
52
->with($field,
null
)
53
->willReturn($expected);
54
55
$this->assertEquals($expected, $this->model->handle([
'field'
=> $field]));
56
}
57
}
Magento\Payment\Test\Unit\Gateway\Config\ConfigValueHandlerTest\$configMock
$configMock
Definition:
ConfigValueHandlerTest.php:22
$storeId
$storeId
Definition:
customer_review_with_rating.php:14
Magento\Payment\Test\Unit\Gateway\Config
Definition:
ConfigTest.php:6
Magento\Payment\Test\Unit\Gateway\Config\ConfigValueHandlerTest\setUp
setUp()
Definition:
ConfigValueHandlerTest.php:24
Magento\Payment\Gateway\ConfigInterface
Definition:
ConfigInterface.php:14
Magento\Payment\Test\Unit\Gateway\Config\ConfigValueHandlerTest
Definition:
ConfigValueHandlerTest.php:14
Magento\Payment\Test\Unit\Gateway\Config\ConfigValueHandlerTest\$model
$model
Definition:
ConfigValueHandlerTest.php:17
Magento\Payment\Gateway\Config\ConfigValueHandler
Definition:
ConfigValueHandler.php:19
Magento
Magento\Payment\Test\Unit\Gateway\Config\ConfigValueHandlerTest\testHandle
testHandle()
Definition:
ConfigValueHandlerTest.php:31
Magento\Payment\Test\Unit\Gateway\Config\ConfigValueHandlerTest\testHandleWithoutStoreId
testHandleWithoutStoreId()
Definition:
ConfigValueHandlerTest.php:45