Ejemplo n.º 1
0
 public function testGetShippingPrice()
 {
     $shippingPrice = 5;
     $convertedPrice = "\$5";
     $shippingRateMock = $this->getMockBuilder('\\Magento\\Quote\\Model\\Quote\\Address\\Rate')->disableOriginalConstructor()->setMethods(['getPrice', '__wakeup'])->getMock();
     $shippingRateMock->expects($this->once())->method('getPrice')->will($this->returnValue($shippingPrice));
     $this->priceCurrency->expects($this->once())->method('convertAndFormat')->with($shippingPrice, true, true)->willReturn($convertedPrice);
     $this->priceObj->setShippingRate($shippingRateMock);
     $this->assertEquals($convertedPrice, $this->priceObj->getShippingPrice());
 }