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()); }
/** * Constructor * * @param TemplateContext $context * @param Context $renderContext * @param ContentTypeFactory $contentTypeFactory * @param ConfigFactory $configFactory * @param ConfigBuilderInterface $configBuilder * @param DataProviderFactory $dataProviderFactory * @param Manager $dataProviderManager * @param FilterPool $filterPool * @param ResolverInterface $localeResolver * @param array $data * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct(TemplateContext $context, Context $renderContext, ContentTypeFactory $contentTypeFactory, ConfigFactory $configFactory, ConfigBuilderInterface $configBuilder, DataProviderFactory $dataProviderFactory, Manager $dataProviderManager, FilterPool $filterPool, ResolverInterface $localeResolver, array $data = []) { $this->localeDate = $context->getLocaleDate(); $this->scopeConfig = $context->getScopeConfig(); $this->localeResolver = $localeResolver; parent::__construct($context, $renderContext, $contentTypeFactory, $configFactory, $configBuilder, $dataProviderFactory, $dataProviderManager, $filterPool, $data); }
public function __construct(\Magento\Framework\View\Element\Template\Context $context, $data = array()) { $this->scopeConfig = $context->getScopeConfig(); parent::__construct($context, $data); }
/** * @param Context $context * @param SpringbotHelper $springbotHelper */ public function __construct(Context $context, SpringbotHelper $springbotHelper) { $this->scopeConfig = $context->getScopeConfig(); $this->springbotHelper = $springbotHelper; parent::__construct($context); }
public function __construct(\Magento\Framework\Module\Manager $moduleManager, \Magento\Framework\View\Element\Template\Context $context, array $data = []) { $this->_scopeConfig = $context->getScopeConfig(); $this->_moduleManager = $moduleManager; parent::__construct($context, $data); }
/** * Head constructor. * @param Context $context * @param array $data */ public function __construct(Context $context, array $data) { $this->scopeConfig = $context->getScopeConfig(); parent::__construct($context, $data); }