PageRenderTime 42ms CodeModel.GetById 19ms RepoModel.GetById 0ms app.codeStats 0ms

/src/Symfony/Component/Validator/Tests/Resources/TranslationFilesTest.php

http://github.com/symfony/symfony
PHP | 44 lines | 26 code | 7 blank | 11 comment | 0 complexity | 1e9888c5da17d6b5617f47f77372e518 MD5 | raw file
  1. <?php
  2. /*
  3. * This file is part of the Symfony package.
  4. *
  5. * (c) Fabien Potencier <fabien@symfony.com>
  6. *
  7. * For the full copyright and license information, please view the LICENSE
  8. * file that was distributed with this source code.
  9. */
  10. namespace Symfony\Component\Validator\Tests\Resources;
  11. use PHPUnit\Framework\TestCase;
  12. class TranslationFilesTest extends TestCase
  13. {
  14. /**
  15. * @dataProvider provideTranslationFiles
  16. */
  17. public function testTranslationFileIsValid($filePath)
  18. {
  19. \PHPUnit\Util\XML::loadfile($filePath, false, false, true);
  20. $this->addToAssertionCount(1);
  21. }
  22. public function provideTranslationFiles()
  23. {
  24. return array_map(
  25. function ($filePath) { return (array) $filePath; },
  26. glob(\dirname(__DIR__, 2).'/Resources/translations/*.xlf')
  27. );
  28. }
  29. public function testNorwegianAlias()
  30. {
  31. $this->assertFileEquals(
  32. \dirname(__DIR__, 2).'/Resources/translations/validators.nb.xlf',
  33. \dirname(__DIR__, 2).'/Resources/translations/validators.no.xlf',
  34. 'The NO locale should be an alias for the NB variant of the Norwegian language.'
  35. );
  36. }
  37. }