summaryrefslogtreecommitdiff
path: root/modules/locale
diff options
context:
space:
mode:
authorwebchick <webchick@24967.no-reply.drupal.org>2011-12-24 18:09:18 -0800
committerwebchick <webchick@24967.no-reply.drupal.org>2011-12-24 18:09:18 -0800
commit88b568e272e3776ef217bed4059249f9f62abec3 (patch)
tree5fadf9223182b8d253861ae1bda721cf3ffda9a6 /modules/locale
parent862cfa277446efe0125bd3e40335bcbbebf55299 (diff)
downloadbrdo-88b568e272e3776ef217bed4059249f9f62abec3.tar.gz
brdo-88b568e272e3776ef217bed4059249f9f62abec3.tar.bz2
Issue #381994 by xjm, good_man, elcuco, brianV, yhager: Fixed Machine-name fields are always in Latin characters, and should therefore always be LTR.
Diffstat (limited to 'modules/locale')
-rw-r--r--modules/locale/locale.test28
1 files changed, 28 insertions, 0 deletions
diff --git a/modules/locale/locale.test b/modules/locale/locale.test
index 5eb1cd342..ca945569a 100644
--- a/modules/locale/locale.test
+++ b/modules/locale/locale.test
@@ -1881,6 +1881,34 @@ class LocaleContentFunctionalTest extends DrupalWebTestCase {
}
/**
+ * Verifies that machine name fields are always LTR.
+ */
+ function testMachineNameLTR() {
+ // User to add and remove language.
+ $admin_user = $this->drupalCreateUser(array('administer languages', 'administer content types', 'access administration pages'));
+
+ // Log in as admin.
+ $this->drupalLogin($admin_user);
+
+ // Verify that the machine name field is LTR for a new content type.
+ $this->drupalGet('admin/structure/types/add');
+ $this->assertFieldByXpath('//input[@name="type" and @dir="ltr"]', NULL, 'The machine name field is LTR when no additional language is configured.');
+
+ // Install the Arabic language (which is RTL) and configure as the default.
+ $edit = array();
+ $edit['langcode'] = 'ar';
+ $this->drupalPost('admin/config/regional/language/add', $edit, t('Add language'));
+
+ $edit = array();
+ $edit['site_default'] = 'ar';
+ $this->drupalPost(NULL, $edit, t('Save configuration'));
+
+ // Verify that the machine name field is still LTR for a new content type.
+ $this->drupalGet('admin/structure/types/add');
+ $this->assertFieldByXpath('//input[@name="type" and @dir="ltr"]', NULL, 'The machine name field is LTR when the default language is RTL.');
+ }
+
+ /**
* Test if a content type can be set to multilingual and language setting is
* present on node add and edit forms.
*/