Example #1
0
    public function testToHtml()
    {
        $this->context->expects($this->once())->method('getEventManager')->will($this->returnValue($this->getMockForAbstractClass('\\Magento\\Framework\\Event\\ManagerInterface')));
        $this->context->expects($this->once())->method('getScopeConfig')->will($this->returnValue($this->getMockForAbstractClass('\\Magento\\Framework\\App\\Config\\ScopeConfigInterface')));
        $this->config->expects($this->once())->method('getBaseConfig')->will($this->returnValue('the config data'));
        $object = new Config($this->context, $this->config, $this->fileManager, $this->pageConfig);
        $html = $object->toHtml();
        $expectedFormat = <<<expected
<script type="text/javascript">
the config data</script>
expected;
        $this->assertStringMatchesFormat($expectedFormat, $html);
    }