/** * Make sure that isMessagesAvailable is not called */ public function testGetInlineForCheckout() { $expectedHtml = '<a href="here">here</a>'; $layoutMock = $this->getMock('\\Magento\\Framework\\View\\Layout', array(), array(), '', false); $entityMock = $this->getMock('\\Magento\\Framework\\Object', array(), array(), '', false); $inlineMock = $this->getMock('Magento\\GiftMessage\\Block\\Message\\Inline', array('setId', 'setDontDisplayContainer', 'setEntity', 'setType', 'toHtml'), array(), '', false); $this->layoutFactoryMock->expects($this->once())->method('create')->will($this->returnValue($layoutMock)); $layoutMock->expects($this->once())->method('createBlock')->will($this->returnValue($inlineMock)); $inlineMock->expects($this->once())->method('setId')->will($this->returnSelf()); $inlineMock->expects($this->once())->method('setDontDisplayContainer')->will($this->returnSelf()); $inlineMock->expects($this->once())->method('setEntity')->with($entityMock)->will($this->returnSelf()); $inlineMock->expects($this->once())->method('setType')->will($this->returnSelf()); $inlineMock->expects($this->once())->method('toHtml')->will($this->returnValue($expectedHtml)); $this->assertEquals($expectedHtml, $this->helper->getInline('onepage_checkout', $entityMock)); }
/** * Get items box message text for multishipping * * @param \Magento\Multishipping\Block\Checkout\Shipping $subject * @param callable $proceed * @param \Magento\Framework\DataObject $addressEntity * * @return string * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ public function aroundGetItemsBoxTextAfter(\Magento\Multishipping\Block\Checkout\Shipping $subject, \Closure $proceed, \Magento\Framework\DataObject $addressEntity) { $itemsBoxText = $proceed($addressEntity); return $itemsBoxText . $this->helper->getInline('multishipping_address', $addressEntity); }