/** * @test */ public function getTargetBySourceLogsSilentlyIfNoTransUnitsArePresent() { $this->mockXliffParser = $this->getMock(\TYPO3\Flow\I18n\Xliff\XliffParser::class); $this->mockXliffParser->expects($this->once())->method('getParsedData')->will($this->returnValue(array())); $mockLogger = $this->getMock(\TYPO3\Flow\Log\SystemLoggerInterface::class, array(), array(), '', false); $mockLogger->expects($this->once())->method('log')->with($this->stringStartsWith('No trans-unit elements were found'), LOG_DEBUG); $this->model->injectParser($this->mockXliffParser); $this->inject($this->model, 'i18nLogger', $mockLogger); $this->model->initializeObject(); $this->model->getTargetBySource('foo'); }
/** * @test */ public function getTargetBySourceLogsSilentlyIfNoTransUnitsArePresent() { $this->mockXliffParser = $this->getMock('TYPO3\\Flow\\I18n\\Xliff\\XliffParser'); $this->mockXliffParser->expects($this->once())->method('getParsedData')->will($this->returnValue(array())); $mockSystemLogger = $this->getMock('TYPO3\\Flow\\Log\\SystemLoggerInterface', array(), array(), '', FALSE); $mockSystemLogger->expects($this->once())->method('log')->with($this->stringStartsWith('No trans-unit elements were found'), LOG_WARNING); $this->model->injectParser($this->mockXliffParser); $this->inject($this->model, 'systemLogger', $mockSystemLogger); $this->model->initializeObject(); $this->model->getTargetBySource('foo'); }