diff options
author | Angie Byron <webchick@24967.no-reply.drupal.org> | 2010-10-01 22:03:29 +0000 |
---|---|---|
committer | Angie Byron <webchick@24967.no-reply.drupal.org> | 2010-10-01 22:03:29 +0000 |
commit | 3858e1a19f9b8331d01cc7ab45d28b5575c0e260 (patch) | |
tree | c55ae9c4a8216b8ecade83c7b5328cf1ee9d2c7d /modules/simpletest | |
parent | 7f5caaacdca6de4876ee876a9d1de5ce97ea0c93 (diff) | |
download | brdo-3858e1a19f9b8331d01cc7ab45d28b5575c0e260.tar.gz brdo-3858e1a19f9b8331d01cc7ab45d28b5575c0e260.tar.bz2 |
#926794 by ksenzee, moshe weitzman, Jody Lynn: Fixed revisions of unpublished nodes lose their body field on upgrade.
Diffstat (limited to 'modules/simpletest')
-rw-r--r-- | modules/simpletest/tests/upgrade/upgrade.node.test | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/modules/simpletest/tests/upgrade/upgrade.node.test b/modules/simpletest/tests/upgrade/upgrade.node.test index f5cb3dffb..08617a956 100644 --- a/modules/simpletest/tests/upgrade/upgrade.node.test +++ b/modules/simpletest/tests/upgrade/upgrade.node.test @@ -26,10 +26,19 @@ class NodeBodyUpgradePathTestCase extends UpgradePathTestCase { /** * Test a successful upgrade. */ - public function testNodyBodyUpgrade() { + public function testNodeBodyUpgrade() { $this->assertTrue($this->performUpgrade(), t('The upgrade was completed successfully.')); $this->drupalGet("content/1263769200"); $this->assertText('node body (broken) - 37'); + + // Find a published node revision and make sure it still has a body. + $revision = db_query_range("SELECT r.nid, r.vid FROM {node_revision} r JOIN {node} n ON n.nid = r.nid WHERE n.status = 1 AND n.type <> 'poll' AND n.vid <> r.vid", 0, 1)->fetch(); + $revision = node_load($revision->nid, $revision->vid); + $this->assertTrue(!empty($revision->body), 'Non-current node revisions still have a node body.'); + // Find an unpublished node revision and make sure it still has a body. + $revision = db_query_range("SELECT r.nid, r.vid FROM {node_revision} r JOIN {node} n ON n.nid = r.nid WHERE n.status = 0 AND n.type <> 'poll' AND n.vid <> r.vid", 0, 1)->fetch(); + $revision = node_load($revision->nid, $revision->vid); + $this->assertTrue(!empty($revision->body), 'Unpublished non-current node revisions still have a node body.'); } } |