22 $objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this);
23 $this->layoutFactoryMock = $this->createMock(\
Magento\Framework\View\LayoutFactory::class);
26 \
Magento\GiftMessage\Helper\Message::class,
28 'layoutFactory' => $this->layoutFactoryMock,
29 'skipMessageCheck' => [
'onepage_checkout']
39 $expectedHtml =
'<a href="here">here</a>';
40 $layoutMock = $this->createMock(\
Magento\Framework\View\Layout::class);
41 $entityMock = $this->createMock(\
Magento\Framework\DataObject::class);
42 $inlineMock = $this->createPartialMock(
43 \
Magento\GiftMessage\Block\Message\Inline::class,
44 [
'setId',
'setDontDisplayContainer',
'setEntity',
'setCheckoutType',
'toHtml']
47 $this->layoutFactoryMock->expects($this->once())->method(
'create')->will($this->returnValue($layoutMock));
48 $layoutMock->expects($this->once())->method(
'createBlock')->will($this->returnValue($inlineMock));
50 $inlineMock->expects($this->once())->method(
'setId')->will($this->returnSelf());
51 $inlineMock->expects($this->once())->method(
'setDontDisplayContainer')->will($this->returnSelf());
52 $inlineMock->expects($this->once())->method(
'setEntity')->with($entityMock)->will($this->returnSelf());
53 $inlineMock->expects($this->once())->method(
'setCheckoutType')->will($this->returnSelf());
54 $inlineMock->expects($this->once())->method(
'toHtml')->will($this->returnValue($expectedHtml));
56 $this->assertEquals($expectedHtml, $this->helper->getInline(
'onepage_checkout', $entityMock));
testGetInlineForCheckout()