コード例 #1
0
 public function testGetShippingPrice()
 {
     $addressMock = $this->getMock('Magento\\Quote\\Model\\Quote\\Address', ['getQuote', '__wakeup'], [], '', false);
     $quoteMock = $this->getMock('Magento\\Quote\\Model\\Quote', [], [], '', false);
     $storeMock = $this->getMock('Magento\\Store\\Model\\Store', [], [], '', false);
     $price = 100;
     $flag = true;
     $shippingPrice = 11.11;
     $this->taxHelperMock->expects($this->once())->method('getShippingPrice')->with($price, $flag, $addressMock)->will($this->returnValue($shippingPrice));
     $addressMock->expects($this->once())->method('getQuote')->will($this->returnValue($quoteMock));
     $quoteMock->expects($this->once())->method('getStore')->will($this->returnValue($storeMock));
     $this->priceCurrencyMock->expects($this->once())->method('convertAndFormat')->with($shippingPrice, true, PriceCurrencyInterface::DEFAULT_PRECISION, $storeMock);
     $this->model->getShippingPrice($addressMock, $price, $flag);
 }