summaryrefslogtreecommitdiff
path: root/modules/translation
diff options
context:
space:
mode:
authorwebchick <webchick@24967.no-reply.drupal.org>2011-07-20 01:20:33 -0700
committerwebchick <webchick@24967.no-reply.drupal.org>2011-07-20 01:20:33 -0700
commitbe1bb23a1e16af14ca9ee7401e9be528c43796ed (patch)
treee754a1815dc836b9813e46b710facebd0a303d9c /modules/translation
parentee8670c29533a96fe1aa0b08e95d7327b983066b (diff)
downloadbrdo-be1bb23a1e16af14ca9ee7401e9be528c43796ed.tar.gz
brdo-be1bb23a1e16af14ca9ee7401e9be528c43796ed.tar.bz2
Issue #1164852 by plach: Default the 'translatable' bit on fields to FALSE for fields created in the UI, to match those created by the API.
Diffstat (limited to 'modules/translation')
-rw-r--r--modules/translation/translation.test13
1 files changed, 7 insertions, 6 deletions
diff --git a/modules/translation/translation.test b/modules/translation/translation.test
index 54b53d9fd..fe320a935 100644
--- a/modules/translation/translation.test
+++ b/modules/translation/translation.test
@@ -108,9 +108,9 @@ class TranslationTestCase extends DrupalWebTestCase {
// Update original and mark translation as outdated.
$node_body = $this->randomName();
- $node->body[$node->language][0]['value'] = $node_body;
+ $node->body[LANGUAGE_NONE][0]['value'] = $node_body;
$edit = array();
- $edit["body[$node->language][0][value]"] = $node_body;
+ $edit["body[$langcode][0][value]"] = $node_body;
$edit['translation[retranslate]'] = TRUE;
$this->drupalPost('node/' . $node->nid . '/edit', $edit, t('Save'));
$this->assertRaw(t('Basic page %title has been updated.', array('%title' => $node_title)), t('Original node updated.'));
@@ -121,7 +121,7 @@ class TranslationTestCase extends DrupalWebTestCase {
// Update translation and mark as updated.
$edit = array();
- $edit["body[$node_translation->language][0][value]"] = $this->randomName();
+ $edit["body[$langcode][0][value]"] = $this->randomName();
$edit['translation[status]'] = FALSE;
$this->drupalPost('node/' . $node_translation->nid . '/edit', $edit, t('Save'));
$this->assertRaw(t('Basic page %title has been updated.', array('%title' => $node_translation_title)), t('Translated node updated.'));
@@ -131,7 +131,7 @@ class TranslationTestCase extends DrupalWebTestCase {
$this->drupalGet('node/add/page');
$this->assertFieldByXPath('//select[@name="language"]//option', 'it', t('Italian (disabled) is available in language selection.'));
$translation_it = $this->createTranslation($node, $this->randomName(), $this->randomName(), 'it');
- $this->assertRaw($translation_it->body['it'][0]['value'], t('Content created in Italian (disabled).'));
+ $this->assertRaw($translation_it->body[LANGUAGE_NONE][0]['value'], t('Content created in Italian (disabled).'));
// Confirm that language neutral is an option for translators when there are
// disabled languages.
@@ -349,9 +349,10 @@ class TranslationTestCase extends DrupalWebTestCase {
function createTranslation($node, $title, $body, $language) {
$this->drupalGet('node/add/page', array('query' => array('translation' => $node->nid, 'target' => $language)));
- $body_key = "body[$language][0][value]";
+ $langcode = LANGUAGE_NONE;
+ $body_key = "body[$langcode][0][value]";
$this->assertFieldByXPath('//input[@id="edit-title"]', $node->title, "Original title value correctly populated.");
- $this->assertFieldByXPath("//textarea[@name='$body_key']", $node->body[$node->language][0]['value'], "Original body value correctly populated.");
+ $this->assertFieldByXPath("//textarea[@name='$body_key']", $node->body[LANGUAGE_NONE][0]['value'], "Original body value correctly populated.");
$edit = array();
$edit["title"] = $title;