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()); }