public function testGetFaviconFile() { $storeMock = $this->getMock('\\Magento\\Store\\Model\\Store', array(), array(), '', false); $storeMock->expects($this->any())->method('getBaseUrl')->will($this->returnValue('baseUrl/')); $this->_context->getStoreManager()->expects($this->any())->method('getStore')->will($this->returnValue($storeMock)); $this->_context->getScopeConfig()->expects($this->any())->method('getValue')->will($this->returnValue('scopeConfig')); $mediaDirMock = $this->getMock('\\Magento\\Framework\\Filesystem\\Directory\\Read', array(), array(), '', false); $mediaDirMock->expects($this->any())->method('isFile')->with('favicon/scopeConfig')->will($this->returnValue(true)); $this->_context->getFilesystem()->expects($this->once())->method('getDirectoryRead')->will($this->returnValue($mediaDirMock)); $this->assertEquals('baseUrl/favicon/scopeConfig', $this->_block->getFaviconFile()); }
public function __construct(\Magento\Framework\View\Element\Template\Context $context, \Riskified\Decider\Api\Config $apiConfig, \Magento\Framework\Session\SessionManagerInterface $session, array $data = []) { $this->validator = $context->getValidator(); $this->resolver = $context->getResolver(); $this->_filesystem = $context->getFilesystem(); $this->templateEnginePool = $context->getEnginePool(); $this->_storeManager = $context->getStoreManager(); $this->_appState = $context->getAppState(); $this->templateContext = $this; $this->pageConfig = $context->getPageConfig(); $this->apiConfig = $apiConfig; $this->session = $session; parent::__construct($context, $data); }
/** * Constructor * * @param Template\Context $context * @param array $data */ public function __construct(Template\Context $context, array $data = []) { $this->_filesystem = $context->getFilesystem(); $this->_viewFileSystem = $context->getViewFileSystem(); $this->templateEnginePool = $context->getEnginePool(); $this->_storeManager = $context->getStoreManager(); $this->_appState = $context->getAppState(); $this->templateContext = $this; $this->pageConfig = $context->getPageConfig(); parent::__construct($context, $data); }