Esempio n. 1
0
 /**
  * Test method testGetValue
  *
  * @param float|bool $price
  * @dataProvider testGetValueDataProvider
  */
 public function testGetValue($price)
 {
     $convertedPrice = 85;
     $this->saleableItemMock->expects($this->once())->method('getPrice')->will($this->returnValue($price));
     $this->priceCurrencyMock->expects($this->any())->method('convertAndRound')->with($price)->will($this->returnValue($convertedPrice));
     $this->assertEquals($convertedPrice, $this->regularPrice->getValue());
     //The second call will use cached value
     $this->assertEquals($convertedPrice, $this->regularPrice->getValue());
 }
Esempio n. 2
0
 /**
  * Test method testGetValue
  *
  * @param float|bool $price
  * @dataProvider testGetValueDataProvider
  */
 public function testGetValue($price)
 {
     $this->saleableItemMock->expects($this->once())->method('getPrice')->will($this->returnValue($price));
     $this->assertEquals($price, $this->regularPrice->getValue());
 }