/** * @param float $finalPrice * @param float $specialPrice * @param int $callsNumber * @param bool $dateInInterval * @param float $expected * * @covers \Magento\Bundle\Model\Product\Price::calculateSpecialPrice * @covers \Magento\Bundle\Model\Product\Price::__construct * @dataProvider calculateSpecialPrice */ public function testCalculateSpecialPrice($finalPrice, $specialPrice, $callsNumber, $dateInInterval, $expected) { $this->localeDateMock->expects($this->exactly($callsNumber))->method('isScopeDateInInterval')->will($this->returnValue($dateInInterval)); $this->storeManagerMock->expects($this->any())->method('getStore')->will($this->returnValue($this->storeMock)); $this->storeMock->expects($this->any())->method('roundPrice')->will($this->returnArgument(0)); $this->assertEquals($expected, $this->model->calculateSpecialPrice($finalPrice, $specialPrice, date('Y-m-d'), date('Y-m-d'))); }