Пример #1
0
 public function testGetFile()
 {
     $theme = $this->getMockForAbstractClass('\\Magento\\Framework\\View\\Design\\ThemeInterface');
     $expected = 'some/file.ext';
     $this->resolver->expects($this->once())->method('resolve')->with(RulePool::TYPE_TEMPLATE_FILE, 'file.ext', 'frontend', $theme, null, 'Magento_Module')->will($this->returnValue($expected));
     $actual = $this->object->getFile('frontend', $theme, 'file.ext', 'Magento_Module');
     $this->assertSame($expected, $actual);
 }
Пример #2
0
 /**
  * Get a template file
  *
  * @param string $fileId
  * @param array $params
  * @return string|bool
  */
 public function getTemplateFileName($fileId, array $params = [])
 {
     list($module, $filePath) = \Magento\Framework\View\Asset\Repository::extractModule($this->normalizePath($fileId));
     if ($module) {
         $params['module'] = $module;
     }
     $this->_assetRepo->updateDesignParams($params);
     return $this->_templateFileResolution->getFile($params['area'], $params['themeModel'], $filePath, $params['module']);
 }