diff options
author | Nicolas Grekas <nicolas.grekas@gmail.com> | 2015-10-07 09:44:07 +0200 |
---|---|---|
committer | Nicolas Grekas <nicolas.grekas@gmail.com> | 2015-10-07 09:44:07 +0200 |
commit | 82a1ebbc0f0a570b28d5ede8243733c20971564c (patch) | |
tree | 8f5c8b38de75c2eb26bf7412cd714b6756c9738f /Tests/TranslationSyncStatusTest.php | |
parent | 4e3ea9f244ad465865c2384f3d9ba2f89361d364 (diff) | |
parent | 5d74e1996313fc483fed9d4040acfa7f7b4fd297 (diff) | |
download | symfony-security-82a1ebbc0f0a570b28d5ede8243733c20971564c.zip symfony-security-82a1ebbc0f0a570b28d5ede8243733c20971564c.tar.gz symfony-security-82a1ebbc0f0a570b28d5ede8243733c20971564c.tar.bz2 |
Merge branch '2.8'
Conflicts:
composer.json
src/Symfony/Bundle/FrameworkBundle/Resources/config/annotations.xml
src/Symfony/Bundle/FrameworkBundle/Resources/config/routing.xml
src/Symfony/Bundle/FrameworkBundle/Resources/config/security_csrf.xml
src/Symfony/Bundle/FrameworkBundle/composer.json
src/Symfony/Component/DependencyInjection/ContainerBuilder.php
src/Symfony/Component/Security/Core/composer.json
src/Symfony/Component/Security/Csrf/composer.json
src/Symfony/Component/Security/Http/composer.json
src/Symfony/Component/Security/composer.json
src/Symfony/Component/Translation/PluralizationRules.php
src/Symfony/Component/VarDumper/Exception/ThrowingCasterException.php
Diffstat (limited to 'Tests/TranslationSyncStatusTest.php')
-rw-r--r-- | Tests/TranslationSyncStatusTest.php | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/Tests/TranslationSyncStatusTest.php b/Tests/TranslationSyncStatusTest.php new file mode 100644 index 0000000..4b72d41 --- /dev/null +++ b/Tests/TranslationSyncStatusTest.php @@ -0,0 +1,63 @@ +<?php + +/* + * This file is part of the Symfony package. + * + * (c) Fabien Potencier <fabien@symfony.com> + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Security\Tests; + +use Symfony\Component\Finder\Finder; + +class TranslationSyncStatusTest extends \PHPUnit_Framework_TestCase +{ + /** + * @dataProvider getTranslationDirectoriesData + */ + public function testTranslationFileIsNotMissingInCore($dir1, $dir2) + { + $finder = new Finder(); + $files = $finder->in($dir1)->files(); + + foreach ($files as $file) { + $this->assertFileExists($dir2.'/'.$file->getFilename(), 'Missing file '.$file->getFilename().' in directory '.$dir2); + } + } + + public function getTranslationDirectoriesData() + { + $legacyTranslationsDir = $this->getLegacyTranslationsDirectory(); + $coreTranslationsDir = $this->getCoreTranslationsDirectory(); + + return array( + 'file-not-missing-in-core' => array($legacyTranslationsDir, $coreTranslationsDir), + 'file-not-added-in-core' => array($coreTranslationsDir, $legacyTranslationsDir), + ); + } + + public function testFileContentsAreEqual() + { + $finder = new Finder(); + $files = $finder->in($this->getLegacyTranslationsDirectory())->files(); + + foreach ($files as $file) { + $coreFile = $this->getCoreTranslationsDirectory().'/'.$file->getFilename(); + + $this->assertFileEquals($file->getRealPath(), $coreFile, $file.' and '.$coreFile.' have equal content.'); + } + } + + private function getLegacyTranslationsDirectory() + { + return __DIR__.'/../Resources/translations'; + } + + private function getCoreTranslationsDirectory() + { + return __DIR__.'/../Core/Resources/translations'; + } +} |