@@ -181,27 +181,11 @@ public function providerForGetterTierPriceList()
181
181
/**
182
182
* @dataProvider providerForTestGetSavePercent
183
183
*/
184
- public function testGetSavePercent ($ baseAmount , $ tierPrice , $ savePercent )
184
+ public function testGetSavePercent ($ baseAmount , $ savePercent )
185
185
{
186
186
/** @var \Magento\Framework\Pricing\Amount\AmountInterface|\PHPUnit_Framework_MockObject_MockObject $amount */
187
187
$ amount = $ this ->getMockForAbstractClass ('Magento\Framework\Pricing\Amount\AmountInterface ' );
188
- $ amount ->expects ($ this ->any ())
189
- ->method ('getValue ' )
190
- ->will ($ this ->returnValue ($ tierPrice ));
191
-
192
- $ priceAmount = $ this ->getMockForAbstractClass ('Magento\Framework\Pricing\Amount\AmountInterface ' );
193
- $ priceAmount ->expects ($ this ->any ())
194
- ->method ('getValue ' )
195
- ->will ($ this ->returnValue ($ baseAmount ));
196
-
197
- $ price = $ this ->getMock ('Magento\Framework\Pricing\Price\PriceInterface ' );
198
- $ price ->expects ($ this ->any ())
199
- ->method ('getAmount ' )
200
- ->will ($ this ->returnValue ($ priceAmount ));
201
-
202
- $ this ->priceInfo ->expects ($ this ->any ())
203
- ->method ('getPrice ' )
204
- ->will ($ this ->returnValue ($ price ));
188
+ $ amount ->expects ($ this ->once ())->method ('getBaseAmount ' )->willReturn ($ baseAmount );
205
189
206
190
$ this ->assertEquals ($ savePercent , $ this ->model ->getSavePercent ($ amount ));
207
191
}
@@ -212,8 +196,10 @@ public function testGetSavePercent($baseAmount, $tierPrice, $savePercent)
212
196
public function providerForTestGetSavePercent ()
213
197
{
214
198
return [
215
- 'no fraction ' => [9.0000 , 8.1 , 10 ],
216
- 'lower half ' => [9.1234 , 8.3 , 9 ],
199
+ 'no fraction ' => [10.0000 , 10 ],
200
+ 'lower half ' => [10.1234 , 10 ],
201
+ 'half way ' => [10.5000 , 11 ],
202
+ 'upper half ' => [10.6789 , 11 ],
217
203
];
218
204
}
219
205
}
0 commit comments