10 class JsTest extends \PHPUnit\Framework\TestCase
29 $objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this);
30 $this->configMock = $this->getMockBuilder(\
Magento\Translation\Model\
Js\Config::class)
31 ->disableOriginalConstructor()
33 $this->fileManagerMock = $this->getMockBuilder(\
Magento\Translation\Model\FileManager::class)
34 ->disableOriginalConstructor()
37 \
Magento\Translation\Block\Js::class,
39 'config' => $this->configMock,
40 'fileManager' => $this->fileManagerMock
47 $this->configMock->expects($this->once())
48 ->method(
'dictionaryEnabled')
50 $this->assertTrue($this->model->dictionaryEnabled());
55 $this->fileManagerMock->expects($this->once())
56 ->method(
'getTranslationFileTimestamp')
57 ->willReturn(1445736974);
58 $this->assertEquals(1445736974, $this->model->getTranslationFileTimestamp());
63 $this->fileManagerMock->expects($this->once())
64 ->method(
'getTranslationFilePath')
65 ->willReturn(
'frontend/Magento/luma/en_EN');
66 $this->assertEquals(
'frontend/Magento/luma/en_EN', $this->model->getTranslationFilePath());
73 $this->fileManagerMock->expects($this->once())
74 ->method(
'getTranslationFileVersion')
76 $this->assertEquals(
$version, $this->model->getTranslationFileVersion());
testGetTranslationFileTimestamp()
testGetTranslationFileVersion()
testGetTranslationFilePath()
testIsDictionaryStrategy()