'node']; protected function setUp() { $this->context = $this->createMock(\Magento\Backend\Block\Template\Context::class); $this->jsonEncoderMock = $this->createMock(\Magento\Framework\Json\Encoder::class); $this->compositeConfigProvider = $this->createMock(\Magento\GiftMessage\Model\CompositeConfigProvider::class); $this->layoutProcessorMock = $this->getMockForAbstractClass( \Magento\Checkout\Block\Checkout\LayoutProcessorInterface::class, [], '', false ); $this->model = new GiftOptions( $this->context, $this->jsonEncoderMock, $this->compositeConfigProvider, [$this->layoutProcessorMock], ['jsLayout' => $this->jsLayout] ); } public function testGetJsLayout() { $this->layoutProcessorMock->expects($this->once()) ->method('process') ->with($this->jsLayout) ->willReturnArgument(0); $this->jsonEncoderMock->expects($this->once()) ->method('encode') ->with($this->jsLayout) ->willReturnArgument(0); $this->assertEquals($this->jsLayout, $this->model->getJsLayout()); } public function testGetGiftOptionsConfigJson() { $this->compositeConfigProvider->expects($this->once()) ->method('getConfig') ->willReturn($this->jsLayout); $this->jsonEncoderMock->expects($this->once()) ->method('encode') ->with($this->jsLayout) ->willReturnArgument(0); $this->assertEquals($this->jsLayout, $this->model->getGiftOptionsConfigJson()); } }