コード例 #1
0
 public function testConvertPrice()
 {
     $price = 5.5;
     $quoteMock = $this->getMock('\\Magento\\Sales\\Model\\Quote', array(), array(), '', false);
     $storeMock = $this->getMock('Magento\\Store\\Model\\Store', array('convertPrice', '__wakeup'), array(), '', false);
     $this->_checkoutSession->expects($this->once())->method('getQuote')->will($this->returnValue($quoteMock));
     $quoteMock->expects($this->once())->method('getStore')->will($this->returnValue($storeMock));
     $storeMock->expects($this->once())->method('convertPrice')->will($this->returnValue('5.5'));
     $this->assertEquals(5.5, $this->_helper->convertPrice($price));
 }
コード例 #2
0
ファイル: DataTest.php プロジェクト: nja78/magento2
 public function testConvertPrice()
 {
     $price = 5.5;
     $this->priceCurrency->expects($this->once())->method('convertAndFormat')->willReturn($price);
     $this->assertEquals(5.5, $this->_helper->convertPrice($price));
 }