/** * Test method testGetDisplayValue */ public function testGetAmount() { $priceValue = 77; $convertedPrice = 56.32; $amountValue = 88; $this->saleableItemMock->expects($this->once())->method('getPrice')->will($this->returnValue($priceValue)); $this->priceCurrencyMock->expects($this->any())->method('convertAndRound')->with($priceValue)->will($this->returnValue($convertedPrice)); $this->calculatorMock->expects($this->once())->method('getAmount')->with($this->equalTo($convertedPrice))->will($this->returnValue($amountValue)); $this->assertEquals($amountValue, $this->regularPrice->getAmount()); }
/** * Test method testGetDisplayValue */ public function testGetAmount() { $priceValue = 77; $amountValue = 88; $this->calculatorMock->expects($this->once())->method('getAmount')->with($this->equalTo($priceValue))->will($this->returnValue($amountValue)); $this->saleableItemMock->expects($this->once())->method('getPrice')->will($this->returnValue($priceValue)); $this->assertEquals($amountValue, $this->regularPrice->getAmount()); }