Skip to content

Commit

Permalink
[DependencyInjection][Translator] Silent deprecation triggered by lib…
Browse files Browse the repository at this point in the history
…xml_disable_entity_loader
  • Loading branch information
jderusse authored and fabpot committed Nov 27, 2020
1 parent e53c5fa commit 56c8d75
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions Tests/Resources/TranslationFilesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,20 @@ public function testTranslationFileIsValid($filePath)
$this->assertCount(0, $errors, sprintf('"%s" is invalid:%s', $filePath, \PHP_EOL.implode(\PHP_EOL, array_column($errors, 'message'))));
}

/**
* @dataProvider provideTranslationFiles
*/
public function testTranslationFileIsValidWithoutEntityLoader($filePath)
{
$document = new \DOMDocument();
$document->loadXML(file_get_contents($filePath));
libxml_disable_entity_loader(true);

$errors = XliffUtils::validateSchema($document);

$this->assertCount(0, $errors, sprintf('"%s" is invalid:%s', $filePath, \PHP_EOL.implode(\PHP_EOL, array_column($errors, 'message'))));
}

public function provideTranslationFiles()
{
return array_map(
Expand Down

0 comments on commit 56c8d75

Please sign in to comment.