4 * This file is part of the Symfony package.
6 * (c) Fabien Potencier <fabien@symfony.com>
8 * For the full copyright and license information, please view the LICENSE
9 * file that was distributed with this source code.
12 namespace Symfony\Component\Validator\Tests\Resources;
14 use PHPUnit\Framework\TestCase;
16 class TranslationFilesTest extends TestCase
19 * @dataProvider provideTranslationFiles
21 public function testTranslationFileIsValid($filePath)
23 if (class_exists('PHPUnit_Util_XML')) {
24 \PHPUnit_Util_XML::loadfile($filePath, false, false, true);
26 \PHPUnit\Util\XML::loadfile($filePath, false, false, true);
29 $this->addToAssertionCount(1);
32 public function provideTranslationFiles()
35 function ($filePath) { return (array) $filePath; },
36 glob(dirname(dirname(__DIR__)).'/Resources/translations/*.xlf')
40 public function testNorwegianAlias()
42 $this->assertFileEquals(
43 dirname(dirname(__DIR__)).'/Resources/translations/validators.nb.xlf',
44 dirname(dirname(__DIR__)).'/Resources/translations/validators.no.xlf',
45 'The NO locale should be an alias for the NB variant of the Norwegian language.'