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-paypal
Test
Unit
Block
Adminhtml
System
Config
ResolutionRulesTest.php
Go to the documentation of this file.
1
<?php
6
namespace
Magento\Paypal\Test\Unit\Block\Adminhtml\System\Config
;
7
8
use
Magento\Backend\Block\Template\Context
;
9
use
Magento\Framework\TestFramework\Unit\Helper\ObjectManager
;
10
use
Magento\Paypal\Block\Adminhtml\System\Config\ResolutionRules
;
11
use
Magento\Paypal\Model\Config\Rules\Reader
;
12
18
class
ResolutionRulesTest
extends
\PHPUnit\Framework\TestCase
19
{
23
protected
$resolutionRules
;
24
26
protected
$context
;
27
31
protected
$readerMock
;
32
38
protected
function
setUp
()
39
{
40
$objectManager
=
new
ObjectManager
($this);
41
42
$this->context =
$objectManager
->getObject(Context::class);
43
44
$this->readerMock = $this->getMockBuilder(Reader::class)
45
->disableOriginalConstructor()
46
->getMock();
47
48
$this->resolutionRules =
new
ResolutionRules
(
49
$this->context,
50
$this->readerMock
51
);
52
}
53
61
public
function
testGetJson
($incoming, $outgoing)
62
{
63
$this->readerMock->expects($this->once())
64
->method(
'read'
)
65
->willReturn($incoming);
66
67
$this->assertEquals(
68
$outgoing,
69
$this->resolutionRules->getJson()
70
);
71
}
72
76
public
function
getJsonDataProvider
()
77
{
78
return
[
79
[[
'test'
=>
'test-value'
],
'{"test":"test-value"}'
],
80
[[],
'{}'
]
81
];
82
}
83
}
Magento\Backend\Block\Template\Context
Definition:
Context.php:23
Magento\Paypal\Test\Unit\Block\Adminhtml\System\Config\ResolutionRulesTest
Definition:
ResolutionRulesTest.php:18
Magento\Paypal\Test\Unit\Block\Adminhtml\System\Config\ResolutionRulesTest\setUp
setUp()
Definition:
ResolutionRulesTest.php:38
Magento\Paypal\Model\Config\Rules\Reader
Definition:
Reader.php:18
$objectManager
$objectManager
Definition:
bootstrap.php:17
Magento\Paypal\Test\Unit\Block\Adminhtml\System\Config
Magento\Paypal\Test\Unit\Block\Adminhtml\System\Config\ResolutionRulesTest\getJsonDataProvider
getJsonDataProvider()
Definition:
ResolutionRulesTest.php:76
Magento\Paypal\Block\Adminhtml\System\Config\ResolutionRules
Definition:
ResolutionRules.php:18
Magento\Paypal\Test\Unit\Block\Adminhtml\System\Config\ResolutionRulesTest\$readerMock
$readerMock
Definition:
ResolutionRulesTest.php:31
Magento\Paypal\Test\Unit\Block\Adminhtml\System\Config\ResolutionRulesTest\$context
$context
Definition:
ResolutionRulesTest.php:26
Magento\Paypal\Test\Unit\Block\Adminhtml\System\Config\ResolutionRulesTest\testGetJson
testGetJson($incoming, $outgoing)
Definition:
ResolutionRulesTest.php:61
Magento\Framework\TestFramework\Unit\Helper\ObjectManager
Definition:
ObjectManager.php:13
Magento\Paypal\Test\Unit\Block\Adminhtml\System\Config\ResolutionRulesTest\$resolutionRules
$resolutionRules
Definition:
ResolutionRulesTest.php:23