Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
TopDestinationCountriesTest.php
Go to the documentation of this file.
1 <?php
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 
46  {
47  return [
48  ['UA,AF', ['UA', 'AF']],
49  ['', []]
50  ];
51  }
52 }
$objectManager
Definition: bootstrap.php:17
$arguments