diff options
author | sgiehl <stefan@piwik.org> | 2014-08-25 01:30:13 +0400 |
---|---|---|
committer | sgiehl <stefan@piwik.org> | 2014-08-25 01:30:13 +0400 |
commit | 97217d72e46433d807ec26a594eba3cd3afb2600 (patch) | |
tree | d6abd6ea107f0cba6ddf646197470a00a98530bc /tests/PHPUnit/Core | |
parent | 8106d4a2c08aa8bc8275d15a198b1dcfa10d2682 (diff) |
fixed tests
Diffstat (limited to 'tests/PHPUnit/Core')
-rw-r--r-- | tests/PHPUnit/Core/Translate/Validate/CoreTranslationsTest.php | 32 | ||||
-rw-r--r-- | tests/PHPUnit/Core/Translate/WriterTest.php | 6 |
2 files changed, 14 insertions, 24 deletions
diff --git a/tests/PHPUnit/Core/Translate/Validate/CoreTranslationsTest.php b/tests/PHPUnit/Core/Translate/Validate/CoreTranslationsTest.php index 63efd407ce..3cde1e42c8 100644 --- a/tests/PHPUnit/Core/Translate/Validate/CoreTranslationsTest.php +++ b/tests/PHPUnit/Core/Translate/Validate/CoreTranslationsTest.php @@ -51,74 +51,66 @@ class CoreTranslationsTest extends PHPUnit_Framework_TestCase 'bla' => 'test text' ) ), - CoreTranslations::ERRORSTATE_MINIMUMTRANSLATIONS - ), - array( - array( - 'General' => array_merge(array_fill(0, 251, 'test'), array( - 'bla' => 'test text' - )) - ), CoreTranslations::ERRORSTATE_LOCALEREQUIRED ), array( array( - 'General' => array_merge(array_fill(0, 251, 'test'), array( + 'General' => array( 'Locale' => 'de_DE.UTF-8' - )) + ) ), CoreTranslations::ERRORSTATE_TRANSLATORINFOREQUIRED ), array( array( - 'General' => array_merge(array_fill(0, 251, 'test'), array( + 'General' => array( 'Locale' => 'de_DE.UTF-8', 'TranslatorName' => 'name', - )) + ) ), CoreTranslations::ERRORSTATE_TRANSLATOREMAILREQUIRED ), array( array( - 'General' => array_merge(array_fill(0, 251, 'test'), array( + 'General' => array( 'Locale' => 'de_DE.UTF-8', 'TranslatorName' => 'name', 'TranslatorEmail' => 'emails', 'LayoutDirection' => 'afd' - )) + ) ), CoreTranslations::ERRORSTATE_LAYOUTDIRECTIONINVALID ), array( array( - 'General' => array_merge(array_fill(0, 251, 'test'), array( + 'General' => array( 'Locale' => 'invalid', 'TranslatorName' => 'name', 'TranslatorEmail' => 'emails', 'LayoutDirection' => 'ltr' - )) + ) ), CoreTranslations::ERRORSTATE_LOCALEINVALID ), array( array( - 'General' => array_merge(array_fill(0, 251, 'test'), array( + 'General' => array( 'Locale' => 'xx_DE.UTF-8', 'TranslatorName' => 'name', 'TranslatorEmail' => 'emails', 'LayoutDirection' => 'ltr' - )) + ) ), CoreTranslations::ERRORSTATE_LOCALEINVALIDLANGUAGE ), array( array( - 'General' => array_merge(array_fill(0, 251, 'test'), array( + 'General' => array( 'Locale' => 'de_XX.UTF-8', 'TranslatorName' => 'name', 'TranslatorEmail' => 'emails', 'LayoutDirection' => 'ltr' - )) + ) ), CoreTranslations::ERRORSTATE_LOCALEINVALIDCOUNTRY ), diff --git a/tests/PHPUnit/Core/Translate/WriterTest.php b/tests/PHPUnit/Core/Translate/WriterTest.php index c62ca6cb35..500009941a 100644 --- a/tests/PHPUnit/Core/Translate/WriterTest.php +++ b/tests/PHPUnit/Core/Translate/WriterTest.php @@ -102,7 +102,6 @@ class WriterTest extends PHPUnit_Framework_TestCase { $translations = json_decode(file_get_contents(PIWIK_INCLUDE_PATH.'/lang/de.json'), true); return array( - array(array('test' => array('test' => 'test')), CoreTranslations::ERRORSTATE_MINIMUMTRANSLATIONS), array(array('General' => array('Locale' => '')) + $translations, CoreTranslations::ERRORSTATE_LOCALEREQUIRED), array(array('General' => array('Locale' => 'de_DE.UTF-8')) + $translations, CoreTranslations::ERRORSTATE_TRANSLATORINFOREQUIRED), array(array('General' => array('Locale' => 'de_DE.UTF-8', @@ -155,8 +154,7 @@ class WriterTest extends PHPUnit_Framework_TestCase $translationsToWrite = array(); $translationsToWrite['General'] = $translations['General']; - $translationsToWrite['UserSettings'] = $translations['UserSettings']; - $translationsToWrite['UserCountry'] = $translations['UserCountry']; + $translationsToWrite['Mobile'] = $translations['Mobile']; $translationsToWrite['General']['Yes'] = 'string with %1$s'; $translationsToWrite['Plugin'] = array( @@ -175,7 +173,7 @@ class WriterTest extends PHPUnit_Framework_TestCase @unlink(PIWIK_INCLUDE_PATH.'/tmp/fr.json'); - $this->assertGreaterThan(40000, $rc); + $this->assertGreaterThan(25000, $rc); $this->assertCount(4, $translationWriter->getFilterMessages()); } |