Example #1
0
 /**
  * @dataProvider getValueDataProvider
  */
 public function testGetMinimalPrice($baseAmount)
 {
     $result = rand(1, 10);
     $this->baseAmount = $baseAmount;
     $this->prepareMock();
     $this->bundleCalculatorMock->expects($this->once())->method('getAmount')->with($this->equalTo($this->baseAmount), $this->equalTo($this->saleableInterfaceMock))->will($this->returnValue($result));
     $this->assertSame($result, $this->finalPrice->getMinimalPrice());
 }
Example #2
0
 public function testGetPriceWithoutOption()
 {
     $result = 5;
     $this->prepareMock();
     $this->bundleCalculatorMock->expects($this->once())->method('getAmountWithoutOption')->with($this->equalTo($this->baseAmount), $this->equalTo($this->saleableInterfaceMock))->will($this->returnValue($result));
     $this->assertSame($result, $this->finalPrice->getPriceWithoutOption());
     //The second call should use cached value
     $this->assertSame($result, $this->finalPrice->getPriceWithoutOption());
 }