Skip to content

Commit

Permalink
MAGETWO-59512: [GitHub] Products in wishlist show $0.00 price #6866
Browse files Browse the repository at this point in the history
  • Loading branch information
Stanislav Idolov committed Oct 21, 2016
1 parent e05483d commit 42dbe3f
Showing 1 changed file with 8 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,36 +5,30 @@
*/
namespace Magento\Wishlist\Test\Unit\Pricing\ConfiguredPrice;

use Magento\Framework\Pricing\Adjustment\CalculatorInterface;
use Magento\Framework\Pricing\PriceCurrencyInterface;
use Magento\Framework\Pricing\PriceInfoInterface;
use Magento\Framework\Pricing\SaleableInterface;
use Magento\Wishlist\Pricing\ConfiguredPrice\ConfigurableProduct;

class ConfigurableProductTest extends \PHPUnit_Framework_TestCase
{
/**
* @var SaleableInterface|\PHPUnit_Framework_MockObject_MockObject
* @var \Magento\Framework\Pricing\SaleableInterface|\PHPUnit_Framework_MockObject_MockObject
*/
private $saleableItem;

/**
* @var CalculatorInterface|\PHPUnit_Framework_MockObject_MockObject
* @var \Magento\Framework\Pricing\Adjustment\CalculatorInterface|\PHPUnit_Framework_MockObject_MockObject
*/
private $calculator;

/**
* @var PriceCurrencyInterface|\PHPUnit_Framework_MockObject_MockObject
* @var \Magento\Framework\Pricing\PriceCurrencyInterface|\PHPUnit_Framework_MockObject_MockObject
*/
private $priceCurrency;

/**
* @var ConfigurableProduct
* @var \Magento\Wishlist\Pricing\ConfiguredPrice\ConfigurableProduct
*/
private $model;

/**
* @var PriceInfoInterface|\PHPUnit_Framework_MockObject_MockObject
* @var \Magento\Framework\Pricing\PriceInfoInterface|\PHPUnit_Framework_MockObject_MockObject
*/
private $priceInfoMock;

Expand All @@ -56,7 +50,7 @@ protected function setUp()
$this->priceCurrency = $this->getMockBuilder(\Magento\Framework\Pricing\PriceCurrencyInterface::class)
->getMockForAbstractClass();

$this->model = new ConfigurableProduct(
$this->model = new \Magento\Wishlist\Pricing\ConfiguredPrice\ConfigurableProduct(
$this->saleableItem,
null,
$this->calculator,
Expand All @@ -79,7 +73,7 @@ public function testGetValue()
->getMock();
$this->priceInfoMock->expects($this->once())
->method('getPrice')
->with(ConfigurableProduct::PRICE_CODE)
->with(\Magento\Wishlist\Pricing\ConfiguredPrice\ConfigurableProduct::PRICE_CODE)
->willReturn($priceMock);

$productMock = $this->getMockBuilder(\Magento\Catalog\Model\Product::class)
Expand Down Expand Up @@ -125,7 +119,7 @@ public function testGetValueWithNoCustomOption()

$this->priceInfoMock->expects($this->once())
->method('getPrice')
->with(ConfigurableProduct::PRICE_CODE)
->with(\Magento\Wishlist\Pricing\ConfiguredPrice\ConfigurableProduct::PRICE_CODE)
->willReturn($priceMock);

$this->assertEquals(100, $this->model->getValue());
Expand Down

0 comments on commit 42dbe3f

Please sign in to comment.