public function testGetTranslationFileTimestamp() { $path = 'path'; $contextMock = $this->getMockForAbstractClass('\\Magento\\Framework\\View\\Asset\\ContextInterface', [], '', true, true, true, ['getPath']); $this->assetRepoMock->expects($this->atLeastOnce())->method('getStaticViewFileContext')->willReturn($contextMock); $contextMock->expects($this->atLeastOnce())->method('getPath')->willReturn($path); $this->directoryListMock->expects($this->atLeastOnce())->method('getPath')->willReturn($path); $this->driverFileMock->expects($this->once())->method('isExists')->with('path/path/js-translation.json')->willReturn(true); $this->driverFileMock->expects($this->once())->method('stat')->willReturn(['mtime' => 1445736974]); $this->assertEquals(1445736974, $this->model->getTranslationFileTimestamp()); }
/** * gets current js-translation.json timestamp * * @return string */ public function getTranslationFileTimestamp() { return $this->fileManager->getTranslationFileTimestamp(); }