Updated to Drupal 8.5. Core Media not yet in use.
[yaffs-website] / vendor / symfony / validator / Tests / Resources / TranslationFilesTest.php
1 <?php
2
3 /*
4  * This file is part of the Symfony package.
5  *
6  * (c) Fabien Potencier <fabien@symfony.com>
7  *
8  * For the full copyright and license information, please view the LICENSE
9  * file that was distributed with this source code.
10  */
11
12 namespace Symfony\Component\Validator\Tests\Resources;
13
14 use PHPUnit\Framework\TestCase;
15
16 class TranslationFilesTest extends TestCase
17 {
18     /**
19      * @dataProvider provideTranslationFiles
20      */
21     public function testTranslationFileIsValid($filePath)
22     {
23         if (class_exists('PHPUnit_Util_XML')) {
24             \PHPUnit_Util_XML::loadfile($filePath, false, false, true);
25         } else {
26             \PHPUnit\Util\XML::loadfile($filePath, false, false, true);
27         }
28
29         $this->addToAssertionCount(1);
30     }
31
32     public function provideTranslationFiles()
33     {
34         return array_map(
35             function ($filePath) { return (array) $filePath; },
36             glob(dirname(dirname(__DIR__)).'/Resources/translations/*.xlf')
37         );
38     }
39
40     public function testNorwegianAlias()
41     {
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.'
46         );
47     }
48 }