diff --git a/core/modules/locale/lib/Drupal/locale/Tests/LocalePluralFormatTest.php b/core/modules/locale/lib/Drupal/locale/Tests/LocalePluralFormatTest.php index 37ef351..497c824 100644 --- a/core/modules/locale/lib/Drupal/locale/Tests/LocalePluralFormatTest.php +++ b/core/modules/locale/lib/Drupal/locale/Tests/LocalePluralFormatTest.php @@ -121,12 +121,24 @@ class LocalePluralFormatTest extends WebTestBase { foreach ($plural_tests as $langcode => $tests) { foreach ($tests as $count => $expected_plural_index) { // Assert that the we get the right plural index. - $this->assertIdentical(locale_get_plural($count, $langcode), $expected_plural_index, 'Computed plural index for ' . $langcode . ' for count ' . $count . ' is ' . $expected_plural_index); + $this->assertIdentical(locale_get_plural($count, $langcode), $expected_plural_index, + format_string('Computed plural index for %langcode for count %count is %expected', array( + '%langcode' => $langcode, + '%count' => $count, + '%expect' => $expected_plural_index + )) + ); // Assert that the we get the right translation for that. Change the // expected index as per the logic for translation lookups. $expected_plural_index = ($count == 1) ? 0 : $expected_plural_index; $expected_plural_string = str_replace('@count', $count, $plural_strings[$langcode][$expected_plural_index]); - $this->assertIdentical(format_plural($count, '1 hour', '@count hours', array(), array('langcode' => $langcode)), $expected_plural_string, 'Plural translation of 1 hours / @count hours for count ' . $count . ' in ' . $langcode . ' is ' . $expected_plural_string); + $this->assertIdentical(format_plural($count, '1 hour', '@count hours', array(), array('langcode' => $langcode)), $expected_plural_string, + format_string('Plural translation of 1 hours / @count hours for count %count in %langcode is %expected', array( + '%count' => $count, + '%langcode' => $langcode, + '%expected' => $expected_plural_string + )) + ); } } } diff --git a/core/modules/locale/lib/Drupal/locale/Tests/LocaleTranslationTest.php b/core/modules/locale/lib/Drupal/locale/Tests/LocaleTranslationTest.php index 87ca3be..509b272 100644 --- a/core/modules/locale/lib/Drupal/locale/Tests/LocaleTranslationTest.php +++ b/core/modules/locale/lib/Drupal/locale/Tests/LocaleTranslationTest.php @@ -244,14 +244,14 @@ class LocaleTranslationTest extends WebTestBase { $locale_javascripts = variable_get('locale_translation_javascript', array()); $js_file = 'public://' . variable_get('locale_js_directory', 'languages') . '/' . $langcode . '_' . $locale_javascripts[$langcode] . '.js'; - $this->assertTrue($result = file_exists($js_file), format_string('JavaScript file created: %file', array('%file' => $result ? $js_file : t('not found')))); + $this->assertTrue($result = file_exists($js_file), format_string('JavaScript file created: %file', array('%file' => $result ? $js_file : 'not found'))); // Test JavaScript translation rebuilding. file_unmanaged_delete($js_file); - $this->assertTrue($result = !file_exists($js_file), format_string('JavaScript file deleted: %file', array('%file' => $result ? $js_file : t('found')))); + $this->assertTrue($result = !file_exists($js_file), format_string('JavaScript file deleted: %file', array('%file' => $result ? $js_file : 'found'))); cache_invalidate(array('content' => TRUE)); _locale_rebuild_js($langcode); - $this->assertTrue($result = file_exists($js_file), format_string('JavaScript file rebuilt: %file', array('%file' => $result ? $js_file : t('not found')))); + $this->assertTrue($result = file_exists($js_file), format_string('JavaScript file rebuilt: %file', array('%file' => $result ? $js_file : 'not found'))); } /** diff --git a/core/modules/locale/lib/Drupal/locale/Tests/LocaleUninstallTest.php b/core/modules/locale/lib/Drupal/locale/Tests/LocaleUninstallTest.php index f41a752..7141c0e 100644 --- a/core/modules/locale/lib/Drupal/locale/Tests/LocaleUninstallTest.php +++ b/core/modules/locale/lib/Drupal/locale/Tests/LocaleUninstallTest.php @@ -80,7 +80,7 @@ class LocaleUninstallTest extends WebTestBase { _locale_rebuild_js('fr'); $locale_javascripts = variable_get('locale_translation_javascript', array()); $js_file = 'public://' . variable_get('locale_js_directory', 'languages') . '/fr_' . $locale_javascripts['fr'] . '.js'; - $this->assertTrue($result = file_exists($js_file), format_string('JavaScript file created: %file', array('%file' => $result ? $js_file : t('none')))); + $this->assertTrue($result = file_exists($js_file), format_string('JavaScript file created: %file', array('%file' => $result ? $js_file : 'none'))); // Disable string caching. variable_set('locale_cache_strings', 0); @@ -109,7 +109,7 @@ class LocaleUninstallTest extends WebTestBase { $this->assertEqual(language(LANGUAGE_TYPE_INTERFACE)->langcode, 'en', format_string('Language after uninstall: %lang', array('%lang' => language(LANGUAGE_TYPE_INTERFACE)->langcode))); // Check JavaScript files deletion. - $this->assertTrue($result = !file_exists($js_file), format_string('JavaScript file deleted: %file', array('%file' => $result ? $js_file : t('found')))); + $this->assertTrue($result = !file_exists($js_file), format_string('JavaScript file deleted: %file', array('%file' => $result ? $js_file : 'found'))); // Check language count. $language_count = variable_get('language_count', 1);