summaryrefslogtreecommitdiffstats
path: root/Tests/TranslationSyncStatusTest.php
diff options
context:
space:
mode:
authorNicolas Grekas <nicolas.grekas@gmail.com>2015-10-06 19:12:59 +0200
committerNicolas Grekas <nicolas.grekas@gmail.com>2015-10-06 19:12:59 +0200
commitce07ac56f610bc9ca1ef11fddf90d38d3b72f85e (patch)
tree5cce7f9ba7469c8ee4577a0b8ca3c8abe940f9ab /Tests/TranslationSyncStatusTest.php
parent99d73ecb12dedf5c772aab7f00e7d39b60c5f4ed (diff)
parent13818e3015a2a20025ae65b6f57756795eaeda7e (diff)
downloadsymfony-security-ce07ac56f610bc9ca1ef11fddf90d38d3b72f85e.zip
symfony-security-ce07ac56f610bc9ca1ef11fddf90d38d3b72f85e.tar.gz
symfony-security-ce07ac56f610bc9ca1ef11fddf90d38d3b72f85e.tar.bz2
Merge branch '2.7' into 2.8
Conflicts: src/Symfony/Component/Security/Http/Tests/RememberMe/PersistentTokenBasedRememberMeServicesTest.php src/Symfony/Component/Security/Http/Tests/RememberMe/TokenBasedRememberMeServicesTest.php src/Symfony/Component/Security/composer.json
Diffstat (limited to 'Tests/TranslationSyncStatusTest.php')
-rw-r--r--Tests/TranslationSyncStatusTest.php63
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';
+ }
+}