File tree Expand file tree Collapse file tree 3 files changed +11
-16
lines changed
Test/Unit/Block/Item/Price
Weee/Test/Unit/Block/Item/Price Expand file tree Collapse file tree 3 files changed +11
-16
lines changed Original file line number Diff line number Diff line change 1818 * Item price render block
1919 *
2020 * @api
21- * @author Magento Core Team <core@magentocommerce.com>
2221 * @since 100.0.2
2322 */
2423class Renderer extends \Magento \Framework \View \Element \Template
@@ -106,6 +105,8 @@ public function setZone($zone)
106105 }
107106
108107 /**
108+ * Get current store ID
109+ *
109110 * @return int|null|string
110111 */
111112 public function getStoreId ()
@@ -201,19 +202,13 @@ public function formatPrice($price)
201202 }
202203
203204 /**
204- * Get item price in display currency or order currency depending
205- * on item type
205+ * Get item price in display currency or order currency
206206 *
207207 * @return float
208208 */
209209 public function getItemDisplayPriceExclTax ()
210210 {
211- $ item = $ this ->getItem ();
212- if ($ item instanceof QuoteItem) {
213- return $ item ->getCalculationPrice ();
214- } else {
215- return $ item ->getPrice ();
216- }
211+ return $ this ->getItem ()->getPrice ();
217212 }
218213
219214 /**
Original file line number Diff line number Diff line change 11<?php
22/**
3- * Copyright 2015 Adobe
3+ * Copyright 2014 Adobe
44 * All Rights Reserved.
55 */
66declare (strict_types=1 );
@@ -359,11 +359,11 @@ public function testGetItemDisplayPriceExclTaxQuoteItem()
359359 /** @var \Magento\Quote\Model\Quote\Item|MockObject $quoteItemMock */
360360 $ quoteItemMock = $ this ->getMockBuilder (\Magento \Quote \Model \Quote \Item::class)
361361 ->disableOriginalConstructor ()
362- ->onlyMethods (['getCalculationPrice ' , '__wakeup ' ])
362+ ->onlyMethods (['getPrice ' , '__wakeup ' ])
363363 ->getMock ();
364364
365365 $ quoteItemMock ->expects ($ this ->once ())
366- ->method ('getCalculationPrice ' )
366+ ->method ('getPrice ' )
367367 ->willReturn ($ price );
368368
369369 $ this ->renderer ->setItem ($ quoteItemMock );
Original file line number Diff line number Diff line change 11<?php
22/**
3- * Copyright 2015 Adobe
3+ * Copyright 2014 Adobe
44 * All Rights Reserved.
55 */
66declare (strict_types=1 );
@@ -80,7 +80,7 @@ protected function setUp(): void
8080 'getBasePriceInclTax ' ,
8181 'getQtyOrdered '
8282 ])
83- ->onlyMethods (['getCalculationPrice ' ])
83+ ->onlyMethods (['getPrice ' ])
8484 ->getMock ();
8585
8686 $ this ->item ->expects ($ this ->any ())
@@ -291,7 +291,7 @@ public function testGetUnitDisplayPriceExclTax(
291291 ->willReturn ($ weeeTax );
292292
293293 $ this ->item ->expects ($ this ->once ())
294- ->method ('getCalculationPrice ' )
294+ ->method ('getPrice ' )
295295 ->willReturn ($ price );
296296
297297 $ this ->weeeHelper ->expects ($ this ->any ())
@@ -601,7 +601,7 @@ public function testGetFinalUnitDisplayPriceExclTax(
601601 ->willReturn ($ weeeTax );
602602
603603 $ this ->item ->expects ($ this ->once ())
604- ->method ('getCalculationPrice ' )
604+ ->method ('getPrice ' )
605605 ->willReturn ($ rowTotal );
606606
607607 $ this ->assertEquals ($ expectedValue , $ this ->renderer ->getFinalUnitDisplayPriceExclTax ());
You can’t perform that action at this time.
0 commit comments