Ejemplo n.º 1
0
 /**
  * @covers \Magento\Bundle\Pricing\Price\TierPrice::isFirstPriceBetter
  * @dataProvider providerForGetterTierPriceList
  */
 public function testGetterTierPriceList($tierPrices, $basePrice, $expectedResult)
 {
     $this->product->setData(TierPrice::PRICE_CODE, $tierPrices);
     $price = $this->getMock('Magento\\Framework\\Pricing\\Price\\PriceInterface');
     $price->expects($this->any())->method('getValue')->will($this->returnValue($basePrice));
     $this->priceInfo->expects($this->any())->method('getPrice')->will($this->returnValue($price));
     $this->calculator->expects($this->atLeastOnce())->method('getAmount')->will($this->returnArgument(0));
     $this->assertEquals($expectedResult, $this->model->getTierPriceList());
     $this->assertEquals(count($expectedResult), $this->model->getTierPriceCount());
 }
Ejemplo n.º 2
0
 /**
  * @covers \Magento\Bundle\Pricing\Price\TierPrice::isFirstPriceBetter
  * @dataProvider providerForGetterTierPriceList
  */
 public function testGetterTierPriceList($tierPrices, $basePrice, $expectedResult)
 {
     $this->product->setData(TierPrice::PRICE_CODE, $tierPrices);
     $price = $this->getMock('Magento\\Framework\\Pricing\\Price\\PriceInterface');
     $price->expects($this->any())->method('getValue')->will($this->returnValue($basePrice));
     $this->priceInfo->expects($this->any())->method('getPrice')->will($this->returnValue($price));
     $this->calculator->expects($this->atLeastOnce())->method('getAmount')->will($this->returnArgument(0));
     $this->priceCurrencyMock->expects($this->never())->method('convertAndRound');
     $group = $this->getMock('\\Magento\\Customer\\Model\\Data\\Group', [], [], '', false);
     $group->expects($this->any())->method('getId')->willReturn(\Magento\Customer\Model\GroupManagement::CUST_GROUP_ALL);
     $this->groupManagement->expects($this->any())->method('getAllCustomersGroup')->will($this->returnValue($group));
     $this->assertEquals($expectedResult, $this->model->getTierPriceList());
     $this->assertEquals(count($expectedResult), $this->model->getTierPriceCount());
 }