Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
LocaleFileTest.php
Go to the documentation of this file.
1 <?php
8 
9 use \Magento\Framework\View\Design\FileResolution\Fallback\LocaleFile;
10 
12 
13 class LocaleFileTest extends \PHPUnit\Framework\TestCase
14 {
18  protected $resolver;
19 
23  protected $object;
24 
25  protected function setUp()
26  {
27  $this->resolver = $this->createMock(
28  \Magento\Framework\View\Design\FileResolution\Fallback\ResolverInterface::class
29  );
30  $this->object = new LocaleFile($this->resolver);
31  }
32 
33  public function testGetFile()
34  {
35  $theme = $this->getMockForAbstractClass(\Magento\Framework\View\Design\ThemeInterface::class);
36  $expected = 'some/file.ext';
37  $this->resolver->expects($this->once())
38  ->method('resolve')
39  ->with(RulePool::TYPE_LOCALE_FILE, 'file.ext', 'frontend', $theme, 'en_US', null)
40  ->will($this->returnValue($expected));
41  $actual = $this->object->getFile('frontend', $theme, 'en_US', 'file.ext');
42  $this->assertSame($expected, $actual);
43  }
44 }
$theme