6 declare(strict_types=1);
27 private $bundleOptionRegularPrice;
32 private $objectManagerHelper;
37 private $saleableItemMock;
42 private $bundleCalculatorMock;
47 private $bundleOptionsMock;
54 $this->bundleOptionsMock = $this->createMock(BundleOptions::class);
55 $this->saleableItemMock = $this->createMock(Product::class);
56 $this->bundleCalculatorMock = $this->createMock(Calculator::class);
58 $this->objectManagerHelper =
new ObjectManagerHelper($this);
59 $this->bundleOptionRegularPrice = $this->objectManagerHelper->getObject(
60 BundleOptionRegularPrice::class,
62 'saleableItem' => $this->saleableItemMock,
64 'calculator' => $this->bundleCalculatorMock,
65 'bundleOptions' => $this->bundleOptionsMock,
78 $this->bundleOptionsMock->expects($this->any())
79 ->method(
'getOptions')
81 $this->assertEquals(
$collection, $this->bundleOptionRegularPrice->getOptions());
91 $selectionAmount = $this->createMock(AmountInterface::class);
92 $product = $this->createMock(Product::class);
93 $selection = $this->createMock(Selection::class);
94 $this->bundleOptionsMock->expects($this->any())
95 ->method(
'getOptionSelectionAmount')
96 ->will($this->returnValue($selectionAmount))
98 $this->assertEquals($selectionAmount, $this->bundleOptionRegularPrice->getOptionSelectionAmount($selection));
108 $amountMock = $this->createMock(AmountInterface::class);
109 $this->bundleCalculatorMock->expects($this->once())
110 ->method(
'getOptionsAmount')
111 ->with($this->equalTo($this->saleableItemMock))
112 ->will($this->returnValue($amountMock));
113 $this->assertSame($amountMock, $this->bundleOptionRegularPrice->getAmount());
124 $this->bundleOptionsMock->expects($this->any())->method(
'calculateOptions')->will($this->returnValue(
$value));
125 $this->assertEquals(
$value, $this->bundleOptionRegularPrice->getValue());
testGetOptionSelectionAmount()