Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
ConfigTest.php
Go to the documentation of this file.
1 <?php
11 
12 use \Magento\Weee\Model\Config;
13 
14 class ConfigTest extends \PHPUnit\Framework\TestCase
15 {
25  public function testScopeConfigMethods($method, $path, $configValue, $expectedValue)
26  {
27  $scopeConfigMock = $this->getMockForAbstractClass(\Magento\Framework\App\Config\ScopeConfigInterface::class);
28  $scopeConfigMock->expects($this->any())
29  ->method('getValue')
30  ->with($path, \Magento\Store\Model\ScopeInterface::SCOPE_STORE, null)
31  ->will($this->returnValue($configValue));
32  $scopeConfigMock->expects($this->any())
33  ->method('isSetFlag')
34  ->with($path, \Magento\Store\Model\ScopeInterface::SCOPE_STORE, null)
35  ->will($this->returnValue($configValue));
36 
37  $taxData = $this->createMock(\Magento\Tax\Helper\Data::class);
38 
40  $model = new Config($scopeConfigMock, $taxData);
41  $this->assertEquals($expectedValue, $model->{$method}());
42  }
43 
49  {
50  return [
51  [
52  'getPriceDisplayType',
54  true,
55  true,
56  ],
57  [
58  'getListPriceDisplayType',
60  true,
61  true
62  ],
63  [
64  'getSalesPriceDisplayType',
66  true,
67  true
68  ],
69  [
70  'getEmailPriceDisplayType',
72  true,
73  true
74  ],
75  [
76  'includeInSubtotal',
78  true,
79  true
80  ],
81  [
82  'isTaxable',
84  true,
85  true
86  ],
87  [
88  'isEnabled',
90  true,
91  true
92  ]
93  ];
94  }
95 }
const XML_PATH_FPT_DISPLAY_PRODUCT_LIST
Definition: Config.php:23
const XML_PATH_FPT_DISPLAY_PRODUCT_VIEW
Definition: Config.php:21
const XML_PATH_FPT_DISPLAY_SALES
Definition: Config.php:25
const XML_PATH_FPT_INCLUDE_IN_SUBTOTAL
Definition: Config.php:30
$method
Definition: info.phtml:13
const XML_PATH_FPT_DISPLAY_EMAIL
Definition: Config.php:27