8000 Validate XLIFF translation files · fabpot/symfony@db03055 · GitHub
[go: up one dir, main page]

Skip to content

Commit db03055

Browse files
javiereguiluzfabpot
authored andcommitted
Validate XLIFF translation files
1 parent 9124c28 commit db03055

File tree

3 files changed

+93
-0
lines changed

3 files changed

+93
-0
lines changed
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
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\Form\Tests\Resources;
13+
14+
class TranslationFilesTest extends \PHPUnit_Framework_TestCase
15+
{
16+
/**
17+
* @dataProvider provideTranslationFiles
18+
*/
19+
public function testTranslationFileIsValid($filePath)
20+
{
21+
\PHPUnit_Util_XML::loadfile($filePath, false, false, true);
22+
}
23+
24+
public function provideTranslationFiles()
25+
{
26+
return array_map(
27+
function ($filePath) { return (array) $filePath; },
28+
glob(dirname(dirname(__DIR__)).'/Resources/translations/*.xlf')
29+
);
30+
}
31+
}
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
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\Security\Tests\Resources;
13+
14+
class TranslationFilesTest extends \PHPUnit_Framework_TestCase
15+
{
16+
/**
17+
* @dataProvider provideTranslationFiles
18+
*/
19+
public function testTranslationFileIsValid($filePath)
20+
{
21+
\PHPUnit_Util_XML::loadfile($filePath, false, false, true);
22+
}
23+
24+
public function provideTranslationFiles()
25+
{
26+
return array_map(
27+
function ($filePath) { return (array) $filePath; },
28+
glob(dirname(dirname(__DIR__)).'/Resources/translations/*.xlf')
29+
);
30+
}
31+
}
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
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+
class TranslationFilesTest extends \PHPUnit_Framework_TestCase
15+
{
16+
/**
17+
* @dataProvider provideTranslationFiles
18+
*/
19+
public function testTranslationFileIsValid($filePath)
20+
{
21+
\PHPUnit_Util_XML::loadfile($filePath, false, false, true);
22+
}
23+
24+
public function provideTranslationFiles()
25+
{
26+
return array_map(
27+
function ($filePath) { return (array) $filePath; },
28+
glob(dirname(dirname(__DIR__)).'/Resources/translations/*.xlf')
29+
);
30+
}
31+
}

0 commit comments

Comments
 (0)
0