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-directory
Test
Unit
Model
TopDestinationCountriesTest.php
Go to the documentation of this file.
1
<?php
7
namespace
Magento\Directory\Test\Unit\Model
;
8
9
class
TopDestinationCountriesTest
extends
\PHPUnit\Framework\TestCase
10
{
14
protected
$scopeConfigMock
;
15
19
protected
$model
;
20
21
protected
function
setUp
()
22
{
23
$this->scopeConfigMock = $this->getMockBuilder(\
Magento
\Framework\
App
\Config\ScopeConfigInterface::class)
24
->getMock();
25
$objectManager
= new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this);
26
$arguments
= [
27
'scopeConfig'
=>
$this->scopeConfigMock
28
];
29
$this->model =
$objectManager
30
->getObject(\
Magento
\Directory\Model\TopDestinationCountries::class,
$arguments
);
31
}
32
36
public
function
testGetTopDestinations
(
$options
, $expectedResults)
37
{
38
$this->scopeConfigMock->expects($this->once())->method(
'getValue'
)->willReturn(
$options
);
39
$this->assertEquals($expectedResults, $this->model->getTopDestinations());
40
}
41
45
public
function
toTestGetTopDestinationsDataProvider
()
46
{
47
return
[
48
[
'UA,AF'
, [
'UA'
,
'AF'
]],
49
[
''
, []]
50
];
51
}
52
}
Magento\Framework\App
$objectManager
$objectManager
Definition:
bootstrap.php:17
Magento\Directory\Test\Unit\Model\TopDestinationCountriesTest
Definition:
TopDestinationCountriesTest.php:9
Magento\Directory\Test\Unit\Model\TopDestinationCountriesTest\setUp
setUp()
Definition:
TopDestinationCountriesTest.php:21
Magento\Directory\Test\Unit\Model\TopDestinationCountriesTest\testGetTopDestinations
testGetTopDestinations($options, $expectedResults)
Definition:
TopDestinationCountriesTest.php:36
Magento\Directory\Test\Unit\Model\TopDestinationCountriesTest\$model
$model
Definition:
TopDestinationCountriesTest.php:19
Magento\Directory\Test\Unit\Model\TopDestinationCountriesTest\toTestGetTopDestinationsDataProvider
toTestGetTopDestinationsDataProvider()
Definition:
TopDestinationCountriesTest.php:45
Magento
$arguments
$arguments
Definition:
final_price.phtml:24
Magento\Directory\Test\Unit\Model
Definition:
AllowedCountriesTest.php:7
Magento\Directory\Test\Unit\Model\TopDestinationCountriesTest\$scopeConfigMock
$scopeConfigMock
Definition:
TopDestinationCountriesTest.php:14
$options
$options
Definition:
multiple_mixed_products.php:29