Example #1
0
 /**
  * @param float $selectionQty
  * @param float|bool $selectionAmount
  * @dataProvider selectionAmountDataProvider
  */
 public function testGetOptionSelectionAmount($selectionQty, $selectionAmount)
 {
     $selection = $this->getMock('Magento\\Catalog\\Model\\Product', ['getSelectionQty', '__wakeup'], [], '', false);
     $selection->expects($this->once())->method('getSelectionQty')->will($this->returnValue($selectionQty));
     $priceMock = $this->getMock('Magento\\Bundle\\Pricing\\Price\\BundleSelectionPrice', [], [], '', false);
     $priceMock->expects($this->once())->method('getAmount')->will($this->returnValue($selectionAmount));
     $this->selectionFactoryMock->expects($this->once())->method('create')->with($this->equalTo($this->saleableItemMock), $this->equalTo($selection), $this->equalTo($selectionQty))->will($this->returnValue($priceMock));
     $this->assertSame($selectionAmount, $this->bundleOptionPrice->getOptionSelectionAmount($selection));
 }