From 08333ecb11472cad6ffa954e12835ec056360545 Mon Sep 17 00:00:00 2001 From: Christian Flothmann Date: Tue, 6 Oct 2015 15:29:06 +0200 Subject: [PATCH] [Security] sync translations and add a test for it --- .../Resources/translations/security.tr.xlf | 12 ++-- .../Tests/TranslationSyncStatusTest.php | 63 +++++++++++++++++++ src/Symfony/Component/Security/composer.json | 1 + .../Component/Security/phpunit.xml.dist | 2 + 4 files changed, 72 insertions(+), 6 deletions(-) create mode 100644 src/Symfony/Component/Security/Tests/TranslationSyncStatusTest.php diff --git a/src/Symfony/Component/Security/Core/Resources/translations/security.tr.xlf b/src/Symfony/Component/Security/Core/Resources/translations/security.tr.xlf index fbf9b260b05c0..68c44213d18c3 100644 --- a/src/Symfony/Component/Security/Core/Resources/translations/security.tr.xlf +++ b/src/Symfony/Component/Security/Core/Resources/translations/security.tr.xlf @@ -8,7 +8,7 @@ Authentication credentials could not be found. - Yetkilendirme girdileri bulunamadı. + Kimlik bilgileri bulunamadı. Authentication request could not be processed due to a system problem. @@ -16,7 +16,7 @@ Invalid credentials. - Geçersiz girdiler. + Geçersiz kimlik bilgileri. Cookie has already been used by someone else. @@ -32,7 +32,7 @@ Digest nonce has expired. - Derleme zaman aşımı gerçekleşti. + Derleme zaman aşımına uğradı. No authentication provider found to support the authentication token. @@ -44,7 +44,7 @@ No token could be found. - Bilet bulunamadı. + Fiş bulunamadı. Username could not be found. @@ -56,11 +56,11 @@ Credentials have expired. - Girdiler zaman aşımına uğradı. + Kimlik bilgileri zaman aşımına uğradı. Account is disabled. - Hesap devre dışı bırakılmış. + Hesap engellenmiş. Account is locked. diff --git a/src/Symfony/Component/Security/Tests/TranslationSyncStatusTest.php b/src/Symfony/Component/Security/Tests/TranslationSyncStatusTest.php new file mode 100644 index 0000000000000..4b72d41d5a5e1 --- /dev/null +++ b/src/Symfony/Component/Security/Tests/TranslationSyncStatusTest.php @@ -0,0 +1,63 @@ + + * + * 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'; + } +} diff --git a/src/Symfony/Component/Security/composer.json b/src/Symfony/Component/Security/composer.json index 1f0584467ec49..826dcebb3778d 100644 --- a/src/Symfony/Component/Security/composer.json +++ b/src/Symfony/Component/Security/composer.json @@ -28,6 +28,7 @@ "symfony/security-http": "self.version" }, "require-dev": { + "symfony/finder": "~2.3", "symfony/phpunit-bridge": "~2.7", "symfony/intl": "~2.3", "symfony/routing": "~2.2", diff --git a/src/Symfony/Component/Security/phpunit.xml.dist b/src/Symfony/Component/Security/phpunit.xml.dist index 7747b371c1713..3e7ec385260e9 100644 --- a/src/Symfony/Component/Security/phpunit.xml.dist +++ b/src/Symfony/Component/Security/phpunit.xml.dist @@ -12,6 +12,7 @@ + ./Tests/ ./Acl/Tests/ ./Core/Tests/ ./Http/Tests/ @@ -23,6 +24,7 @@ ./ ./vendor + ./Tests ./Acl/Tests ./Core/Tests ./Http/Tests pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy