summaryrefslogtreecommitdiff
path: root/modules/simpletest/tests/upgrade/upgrade.translatable.test
diff options
context:
space:
mode:
authorwebchick <webchick@24967.no-reply.drupal.org>2011-08-23 23:39:37 +0100
committerwebchick <webchick@24967.no-reply.drupal.org>2011-08-23 23:39:37 +0100
commit23c31ac7141f3d8be913705ae269b22187623d98 (patch)
tree4d465518e085aae12c938c3aac59395cc48526c6 /modules/simpletest/tests/upgrade/upgrade.translatable.test
parentcf9c0729fa3620669c99e5675192399f32824852 (diff)
downloadbrdo-23c31ac7141f3d8be913705ae269b22187623d98.tar.gz
brdo-23c31ac7141f3d8be913705ae269b22187623d98.tar.bz2
Issue #1164852 follow-up by plach, chx, Boobaa, sun: Fixed critical regression: Node bodies display as empty after upgrade to 7.7 from 6.x if the nodes have a language.
Diffstat (limited to 'modules/simpletest/tests/upgrade/upgrade.translatable.test')
-rw-r--r--modules/simpletest/tests/upgrade/upgrade.translatable.test51
1 files changed, 51 insertions, 0 deletions
diff --git a/modules/simpletest/tests/upgrade/upgrade.translatable.test b/modules/simpletest/tests/upgrade/upgrade.translatable.test
new file mode 100644
index 000000000..c9360f3b3
--- /dev/null
+++ b/modules/simpletest/tests/upgrade/upgrade.translatable.test
@@ -0,0 +1,51 @@
+<?php
+
+/**
+ * Upgrade test for translatable content types of node.module.
+ */
+class TranslatableUpgradePathTestCase extends UpgradePathTestCase {
+ public static function getInfo() {
+ return array(
+ 'name' => 'Translatable content upgrade path',
+ 'description' => 'Upgrade path tests for the translatable content types of Node module.',
+ 'group' => 'Upgrade path',
+ );
+ }
+
+ public function setUp() {
+ // Path to the database dump files.
+ $this->databaseDumpFiles = array(
+ drupal_get_path('module', 'simpletest') . '/tests/upgrade/drupal-6.filled.database.php',
+ drupal_get_path('module', 'simpletest') . '/tests/upgrade/drupal-6.locale.database.php',
+ drupal_get_path('module', 'simpletest') . '/tests/upgrade/drupal-6.translatable.database.php',
+ );
+ parent::setUp();
+
+ $this->uninstallModulesExcept(array('locale'));
+ }
+
+ /**
+ * Test a successful upgrade (no negotiation).
+ */
+ public function testTranslatableUpgrade() {
+ $this->assertTrue($this->performUpgrade(), t('The upgrade was completed successfully.'));
+
+ // The D6 database contains the english node "First translatable page" with
+ // nid 53.
+ $nid = 53;
+ $title = 'First translatable page';
+ $teaser = 'Teaser of the first translatable page.';
+ $body = 'Body of the first translatable page.';
+
+ // Check whether the node displays properly.
+ $this->drupalGet("node/$nid");
+ $this->assertText($body, t('Translatable node body displays properly'));
+
+ // Retrieve node object, ensure that both the body and the teaser has
+ // survived upgrade properly.
+ $node = $this->drupalGetNodeByTitle($title);
+ $this->assertTrue($node != NULL, t('Node @title was loaded', array('@title' => $title)));
+ $this->assertEqual($node->body[LANGUAGE_NONE][0]['value'], $body, 'Body of the node survived upgrade properly');
+ $this->assertEqual($node->body[LANGUAGE_NONE][0]['summary'], $teaser, 'Teaser of the node survived upgrade properly');
+ }
+}