37 $this->weeeHelperMock = $this->createMock(\
Magento\Weee\Helper\Data::class);
38 $this->weeeConfigMock = $this->createMock(\
Magento\Weee\Model\Config::class);
39 $this->storeManagerMock = $this->createMock(\
Magento\Store\Model\StoreManagerInterface::class);
40 $this->storeMock = $this->createMock(\
Magento\Store\Model\Store::class);
42 $this->storeManagerMock->expects($this->any())->method(
'getStore')->will($this->returnValue($this->storeMock));
44 $this->model = new \Magento\Weee\Model\WeeeConfigProvider(
45 $this->weeeHelperMock,
46 $this->storeManagerMock,
67 $this->storeMock->expects($this->any())->method(
'getId')->will($this->returnValue(
$storeId));
68 $this->weeeHelperMock->expects($this->any())->method(
'isEnabled')->with(
$storeId)
69 ->will($this->returnValue($weeeHelperEnabled));
70 $this->weeeHelperMock->expects($this->any())->method(
'typeOfDisplay')
71 ->will($this->returnValue($displayWeeeDetails));
73 $this->weeeConfigMock->expects($this->any())->method(
'isEnabled')
74 ->will($this->returnValue($weeeConfigEnabled));
75 $this->weeeConfigMock->expects($this->any())->method(
'includeInSubtotal')
76 ->will($this->returnValue($includeInSubtotal));
78 $this->assertEquals($expectedResult, $this->model->getConfig());
89 'isDisplayPriceWithWeeeDetails' =>
false,
90 'isDisplayFinalPrice' =>
true,
91 'isWeeeEnabled' =>
false,
92 'isIncludedInSubtotal' =>
true,
93 'getIncludeWeeeFlag' =>
true,
95 'weeeHelperEnabled' =>
false,
96 'displayWeeeDetails' =>
true,
97 'weeeConfigEnabled' =>
true,
98 'includeInSubtotal' =>
true,
101 'expectedResult' => [
102 'isDisplayPriceWithWeeeDetails' =>
true,
103 'isDisplayFinalPrice' =>
true,
104 'isWeeeEnabled' =>
true,
105 'isIncludedInSubtotal' =>
true,
106 'getIncludeWeeeFlag' =>
true,
108 'weeeHelperEnabled' =>
true,
109 'displayWeeeDetails' =>
true,
110 'weeeConfigEnabled' =>
true,
111 'includeInSubtotal' =>
true,
114 'expectedResult' => [
115 'isDisplayPriceWithWeeeDetails' =>
false,
116 'isDisplayFinalPrice' =>
false,
117 'isWeeeEnabled' =>
true,
118 'isIncludedInSubtotal' =>
true,
119 'getIncludeWeeeFlag' =>
false,
121 'weeeHelperEnabled' =>
true,
122 'displayWeeeDetails' =>
false,
123 'weeeConfigEnabled' =>
true,
124 'includeInSubtotal' =>
true,
127 'expectedResult' => [
128 'isDisplayPriceWithWeeeDetails' =>
false,
129 'isDisplayFinalPrice' =>
false,
130 'isWeeeEnabled' =>
false,
131 'isIncludedInSubtotal' =>
true,
132 'getIncludeWeeeFlag' =>
false,
134 'weeeHelperEnabled' =>
false,
135 'displayWeeeDetails' =>
false,
136 'weeeConfigEnabled' =>
true,
137 'includeInSubtotal' =>
true,
140 'expectedResult' => [
141 'isDisplayPriceWithWeeeDetails' =>
false,
142 'isDisplayFinalPrice' =>
false,
143 'isWeeeEnabled' =>
false,
144 'isIncludedInSubtotal' =>
false,
145 'getIncludeWeeeFlag' =>
false,
147 'weeeHelperEnabled' =>
false,
148 'displayWeeeDetails' =>
false,
149 'weeeConfigEnabled' =>
false,
150 'includeInSubtotal' =>
true,
153 'expectedResult' => [
154 'isDisplayPriceWithWeeeDetails' =>
false,
155 'isDisplayFinalPrice' =>
false,
156 'isWeeeEnabled' =>
false,
157 'isIncludedInSubtotal' =>
false,
158 'getIncludeWeeeFlag' =>
false,
160 'weeeHelperEnabled' =>
false,
161 'displayWeeeDetails' =>
false,
162 'weeeConfigEnabled' =>
true,
163 'includeInSubtotal' =>
false,
166 'expectedResult' => [
167 'isDisplayPriceWithWeeeDetails' =>
false,
168 'isDisplayFinalPrice' =>
false,
169 'isWeeeEnabled' =>
false,
170 'isIncludedInSubtotal' =>
false,
171 'getIncludeWeeeFlag' =>
false,
173 'weeeHelperEnabled' =>
false,
174 'displayWeeeDetails' =>
false,
175 'weeeConfigEnabled' =>
false,
176 'includeInSubtotal' =>
false,
testGetConfig( $expectedResult, $weeeHelperEnabled, $displayWeeeDetails, $weeeConfigEnabled, $includeInSubtotal)