|
8 | 8 |
|
9 | 9 | namespace Magento\Catalog\Test\Unit\Pricing\Price;
|
10 | 10 |
|
11 |
| -use \Magento\Catalog\Pricing\Price\TierPrice; |
12 |
| -use \Magento\Catalog\Pricing\Price\RegularPrice; |
13 |
| - |
| 11 | +use Magento\Catalog\Pricing\Price\TierPrice; |
| 12 | +use Magento\Catalog\Pricing\Price\FinalPrice; |
14 | 13 | use Magento\Customer\Model\Group;
|
15 | 14 | use Magento\Customer\Model\GroupManagement;
|
16 | 15 |
|
@@ -271,6 +270,10 @@ public function testGetterTierPriceList($tierPrices, $basePrice, $expectedResult
|
271 | 270 | $this->calculator->expects($this->atLeastOnce())->method('getAmount')
|
272 | 271 | ->will($this->returnArgument(0));
|
273 | 272 |
|
| 273 | + $this->priceInfo->expects(static::atLeastOnce()) |
| 274 | + ->method('getPrice') |
| 275 | + ->with(FinalPrice::PRICE_CODE) |
| 276 | + ->willReturn($price); |
274 | 277 | $this->priceCurrencyMock->expects($this->any())
|
275 | 278 | ->method('convertAndRound')
|
276 | 279 | ->will($this->returnCallback(
|
@@ -365,20 +368,15 @@ public function providerForGetterTierPriceList()
|
365 | 368 | */
|
366 | 369 | public function testGetSavePercent($basePrice, $tierPrice, $savedPercent)
|
367 | 370 | {
|
368 |
| - $priceAmount = $this->getMockForAbstractClass('Magento\Framework\Pricing\Amount\AmountInterface'); |
369 |
| - $priceAmount->expects($this->once()) |
370 |
| - ->method('getBaseAmount') |
371 |
| - ->will($this->returnValue($basePrice)); |
372 |
| - |
373 | 371 | $price = $this->getMock('Magento\Framework\Pricing\Price\PriceInterface');
|
374 |
| - $price->expects($this->any()) |
375 |
| - ->method('getAmount') |
376 |
| - ->will($this->returnValue($priceAmount)); |
377 | 372 |
|
378 |
| - $this->priceInfo->expects($this->atLeastOnce()) |
| 373 | + $this->priceInfo->expects(static::atLeastOnce()) |
379 | 374 | ->method('getPrice')
|
380 |
| - ->will($this->returnValue($price)) |
381 |
| - ->with(RegularPrice::PRICE_CODE); |
| 375 | + ->with(FinalPrice::PRICE_CODE) |
| 376 | + ->willReturn($price); |
| 377 | + $price->expects(static::atLeastOnce()) |
| 378 | + ->method('getValue') |
| 379 | + ->willReturn($basePrice); |
382 | 380 |
|
383 | 381 | $amount = $this->getMockForAbstractClass('Magento\Framework\Pricing\Amount\AmountInterface');
|
384 | 382 | $amount->expects($this->atLeastOnce())
|
|
0 commit comments