diff options
author | Angie Byron <webchick@24967.no-reply.drupal.org> | 2009-01-22 03:29:01 +0000 |
---|---|---|
committer | Angie Byron <webchick@24967.no-reply.drupal.org> | 2009-01-22 03:29:01 +0000 |
commit | 096309b327b0cf9e8637aadac494860774dc7549 (patch) | |
tree | 7899b0a8f739dfe6cd5839e444075f7c00e0ab3d /modules/locale | |
parent | afc9df994a10a2af320f21fe87f47f10315dd28b (diff) | |
download | brdo-096309b327b0cf9e8637aadac494860774dc7549.tar.gz brdo-096309b327b0cf9e8637aadac494860774dc7549.tar.bz2 |
#352121 by valthebald and Damien Tournoud: Allow importing of invalid tags in .po files into non-default text groups.
Diffstat (limited to 'modules/locale')
-rw-r--r-- | modules/locale/locale.test | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/modules/locale/locale.test b/modules/locale/locale.test index 086a36ec2..79a578e94 100644 --- a/modules/locale/locale.test +++ b/modules/locale/locale.test @@ -191,7 +191,7 @@ class LocaleImportFunctionalTest extends DrupalWebTestCase { protected $admin_user = NULL; function setUp() { - parent::setUp('locale'); + parent::setUp('locale', 'locale_test'); $this->admin_user = $this->drupalCreateUser(array('administer languages', 'translate interface', 'access administration pages')); $this->drupalLogin($this->admin_user); @@ -216,7 +216,7 @@ class LocaleImportFunctionalTest extends DrupalWebTestCase { // The importation should have create 7 strings. $this->assertRaw(t('The translation was successfully imported. There are %number newly created translated strings, %update strings were updated and %delete strings were removed.', array('%number' => 7, '%update' => 0, '%delete' => 0)), t('The translation file was successfully imported')); - // Try importing a .po file with script. + // Try importing a .po file with invalid tags in the default text group. $name = tempnam(file_directory_temp(), "po_"); file_put_contents($name, $this->getBadPoFile()); $this->drupalPost('admin/build/translate/import', array( @@ -229,6 +229,17 @@ class LocaleImportFunctionalTest extends DrupalWebTestCase { $skip_message = format_plural(2, 'One translation string was skipped because it contains disallowed HTML.', '@count translation strings were skipped because they contain disallowed HTML.'); $this->assertRaw($skip_message, t('Unsafe strings were skipped.')); + // Try importing a .po file with invalid tags in a non default text group. + $name = tempnam(file_directory_temp(), "po_"); + file_put_contents($name, $this->getBadPoFile()); + $this->drupalPost('admin/build/translate/import', array( + 'langcode' => 'fr', + 'files[file]' => $name, + 'group' => 'custom', + ), t('Import')); + unlink($name); + // The importation should have created 3 strings. + $this->assertRaw(t('The translation was successfully imported. There are %number newly created translated strings, %update strings were updated and %delete strings were removed.', array('%number' => 3, '%update' => 0, '%delete' => 0)), t('The translation file was successfully imported.')); } /** |