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_LOCALE_FILE, 'file.ext', 'frontend', $theme, 'en_US', null)->will($this->returnValue($expected)); $actual = $this->object->getFile('frontend', $theme, 'en_US', 'file.ext'); $this->assertSame($expected, $actual); }
public function testGetLocaleFileName() { $params = ['area' => 'some_area', 'themeModel' => $this->getMock('Magento\\Framework\\View\\Design\\ThemeInterface', [], [], '', false, false), 'locale' => 'some_locale']; $file = 'some_file.ext'; $expected = 'path/to/some_file.ext'; $this->_localeFileResolution->expects($this->once())->method('getFile')->with($params['area'], $params['themeModel'], $params['locale'], 'some_file.ext')->will($this->returnValue($expected)); $actual = $this->_model->getLocaleFileName($file, $params); $this->assertEquals($expected, $actual); }
/** * Get a locale file * * @param string $file * @param array $params * @return string */ public function getLocaleFileName($file, array $params = []) { $this->_assetRepo->updateDesignParams($params); return $this->_localeFileResolution->getFile($params['area'], $params['themeModel'], $params['locale'], $file); }