Skip to content

Commit

Permalink
[TASK] Make LocallangXmlParserTest notice free
Browse files Browse the repository at this point in the history
Resolves: #84283
Releases: master
Change-Id: I9a047f95ca3cc57d951a36d5b9910678900e100f
Reviewed-on: https://review.typo3.org/56169
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: Jan Helke <typo3@helke.de>
Tested-by: Jan Helke <typo3@helke.de>
Tested-by: TYPO3com <no-reply@typo3.com>
  • Loading branch information
lsascha authored and lolli42 committed Mar 15, 2018
1 parent 8d40230 commit b0dabf7
Showing 1 changed file with 11 additions and 14 deletions.
@@ -1,4 +1,5 @@
<?php
declare(strict_types = 1);
namespace TYPO3\CMS\Core\Tests\Unit\Localization\Parser;

/*
Expand Down Expand Up @@ -28,11 +29,6 @@
*/
class LocallangXmlParserTest extends UnitTestCase
{
/**
* Subject is not notice free, disable E_NOTICES
*/
protected static $suppressNotices = true;

/**
* Prepares the environment before running a test.
*/
Expand Down Expand Up @@ -103,15 +99,16 @@ public function canParseLlxmlInMd5Code()
*/
public function canParseLlxmlInFrenchAndReturnsNullLabelsIfNoTranslationIsFound()
{
$LOCAL_LANG = (new LocallangXmlParser)->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);
}

/**
Expand Down

0 comments on commit b0dabf7

Please sign in to comment.