diff options
author | Dries Buytaert <dries@buytaert.net> | 2011-05-11 21:29:32 -0400 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2011-05-11 21:29:32 -0400 |
commit | 980d5188f7ccd7514347a81e6de753f1fb8b5e7b (patch) | |
tree | d99301f2fedf36a7c7178a480cefaef4aec877ce /modules/simpletest/tests/upgrade | |
parent | b7062f4b21f09ed5921af66449f05d48ece59727 (diff) | |
download | brdo-980d5188f7ccd7514347a81e6de753f1fb8b5e7b.tar.gz brdo-980d5188f7ccd7514347a81e6de753f1fb8b5e7b.tar.bz2 |
- Patch #1017672 by catch, q0rban: D6 to D7 update process permanently deletes comment bodies and other data, and throws fatal SQL errors.
Diffstat (limited to 'modules/simpletest/tests/upgrade')
-rw-r--r-- | modules/simpletest/tests/upgrade/upgrade.node.test | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/modules/simpletest/tests/upgrade/upgrade.node.test b/modules/simpletest/tests/upgrade/upgrade.node.test index 163dbef5e..774ab58e1 100644 --- a/modules/simpletest/tests/upgrade/upgrade.node.test +++ b/modules/simpletest/tests/upgrade/upgrade.node.test @@ -46,6 +46,70 @@ class NodeBodyUpgradePathTestCase extends UpgradePathTestCase { } /** + * Upgrade test for node disabled node types. + * + * Load a filled installation of Drupal 6 and run the upgrade process on it. + */ +class DisabledNodeTypeTestCase extends UpgradePathTestCase { + public static function getInfo() { + return array( + 'name' => 'Disabled node type upgrade path', + 'description' => 'Disabled node type upgrade path tests.', + 'group' => 'Upgrade path', + ); + } + + public function setUp() { + // Path to the database dump. + $this->databaseDumpFiles = array( + drupal_get_path('module', 'simpletest') . '/tests/upgrade/drupal-6.filled.database.php', + drupal_get_path('module', 'simpletest') . '/tests/upgrade/drupal-6.node_type_broken.database.php', + ); + parent::setUp(); + } + + /** + * Test a successful upgrade. + */ + public function testDisabledNodeTypeUpgrade() { + $this->assertTrue($this->performUpgrade(), t('The upgrade was completed successfully.')); + $this->assertTrue(field_info_instance('comment', 'comment_body', 'comment_node_broken'), 'Comment body field instance was created for comments attached to the disabled broken node type'); + } +} + +/** + * Upgrade test for node disabled node types. + * + * Load a filled installation of Drupal 6 and run the upgrade process on it. + */ +class DisabledNodeTypeTestCase extends UpgradePathTestCase { + public static function getInfo() { + return array( + 'name' => 'Disabled node type upgrade path', + 'description' => 'Disabled node type upgrade path tests.', + 'group' => 'Upgrade path', + ); + } + + public function setUp() { + // Path to the database dump. + $this->databaseDumpFiles = array( + drupal_get_path('module', 'simpletest') . '/tests/upgrade/drupal-6.filled.database.php', + drupal_get_path('module', 'simpletest') . '/tests/upgrade/drupal-6.node_type_broken.database.php', + ); + parent::setUp(); + } + + /** + * Test a successful upgrade. + */ + public function testDisabledNodeTypeUpgrade() { + $this->assertTrue($this->performUpgrade(), t('The upgrade was completed successfully.')); + $this->assertTrue(field_info_instance('comment', 'comment_body', 'comment_node_broken'), 'Comment body field instance was created for comments attached to the disabled broken node type'); + } +} + +/** * Upgrade test for node type poll. * * Load a bare installation of Drupal 6 and run the upgrade process on it. |