From b0dabf76df358c072cf31dadb0e55befd9c43f15 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sascha=20L=C3=B6ffler?= Date: Thu, 15 Mar 2018 15:22:19 +0100 Subject: [PATCH] [TASK] Make LocallangXmlParserTest notice free Resolves: #84283 Releases: master Change-Id: I9a047f95ca3cc57d951a36d5b9910678900e100f Reviewed-on: https://review.typo3.org/56169 Reviewed-by: Christian Kuhn Tested-by: Christian Kuhn Reviewed-by: Jan Helke Tested-by: Jan Helke Tested-by: TYPO3com --- .../Parser/LocallangXmlParserTest.php | 25 ++++++++----------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/typo3/sysext/core/Tests/Unit/Localization/Parser/LocallangXmlParserTest.php b/typo3/sysext/core/Tests/Unit/Localization/Parser/LocallangXmlParserTest.php index 75b79a96181b..1b7e2ce730b3 100644 --- a/typo3/sysext/core/Tests/Unit/Localization/Parser/LocallangXmlParserTest.php +++ b/typo3/sysext/core/Tests/Unit/Localization/Parser/LocallangXmlParserTest.php @@ -1,4 +1,5 @@ getParsedData(self::getFixtureFilePath('locallangOnlyDefaultLanguage.xml'), 'fr'); - $expectedLabels = [ - 'label1' => null, - 'label2' => null, - 'label3' => null - ]; - foreach ($expectedLabels as $key => $expectedLabel) { - $this->assertEquals($expectedLabel, $LOCAL_LANG['fr'][$key][0]['target']); - } + $localLang = (new LocallangXmlParser)->getParsedData( + self::getFixtureFilePath('locallangOnlyDefaultLanguage.xml'), + 'fr' + ); + // This test case is odd: The system under test does NOT + // return 'target' at all if there is no such translation. + // @todo: Either change / fix subject, or adapt test and test name! + $this->assertNull($localLang['fr']['label1'][0]['target'] ?? null); + $this->assertNull($localLang['fr']['label2'][0]['target'] ?? null); + $this->assertNull($localLang['fr']['label3'][0]['target'] ?? null); } /**