summaryrefslogtreecommitdiff
path: root/modules/simpletest/tests/upgrade/upgrade.user.test
diff options
context:
space:
mode:
authorwebchick <webchick@24967.no-reply.drupal.org>2011-06-01 09:51:06 -0700
committerwebchick <webchick@24967.no-reply.drupal.org>2011-06-01 09:51:06 -0700
commitdc75725b71c477ee04dc2fb5233da7621c08c32c (patch)
tree823654e1498cf8874b6f5fff0649a90b5d37c783 /modules/simpletest/tests/upgrade/upgrade.user.test
parent6f53d446aaf3008f042a3d294ec4f292f179378d (diff)
downloadbrdo-dc75725b71c477ee04dc2fb5233da7621c08c32c.tar.gz
brdo-dc75725b71c477ee04dc2fb5233da7621c08c32c.tar.bz2
Issue #1014262 by Eric_A, asimmonds: Fixed user_update_7011() completely broken (User email template tokens not upgraded).
Diffstat (limited to 'modules/simpletest/tests/upgrade/upgrade.user.test')
-rw-r--r--modules/simpletest/tests/upgrade/upgrade.user.test60
1 files changed, 60 insertions, 0 deletions
diff --git a/modules/simpletest/tests/upgrade/upgrade.user.test b/modules/simpletest/tests/upgrade/upgrade.user.test
new file mode 100644
index 000000000..6c669219a
--- /dev/null
+++ b/modules/simpletest/tests/upgrade/upgrade.user.test
@@ -0,0 +1,60 @@
+<?php
+/**
+ * Upgrade test for user.module (password token involved).
+ */
+class UserUpgradePathPasswordTokenTestCase extends UpgradePathTestCase {
+ public static function getInfo() {
+ return array(
+ 'name' => 'User upgrade path (password token involved)',
+ 'description' => 'User upgrade path tests (password token involved).',
+ 'group' => 'Upgrade path',
+ );
+ }
+
+ public function setUp() {
+ // Path to the database dump files.
+ $this->databaseDumpFiles = array(
+ drupal_get_path('module', 'simpletest') . '/tests/upgrade/drupal-6.bare.database.php',
+ drupal_get_path('module', 'simpletest') . '/tests/upgrade/drupal-6.user-password-token.database.php',
+ );
+ parent::setUp();
+ }
+
+ /**
+ * Test a successful upgrade.
+ */
+ public function testUserUpgrade() {
+ $this->assertTrue($this->performUpgrade(), 'The upgrade was completed successfully.');
+ $this->assertEqual(variable_get('user_mail_register_no_approval_required_body'), ', [user:name], [site:name], [site:url], [site:url-brief], [user:mail], [date:medium], [site:login-url], [user:edit-url], [user:one-time-login-url].', 'Existing email templates have been modified (password token involved).');
+ }
+}
+
+/**
+ * Upgrade test for user.module (password token not involved).
+ */
+class UserUpgradePathNoPasswordTokenTestCase extends UpgradePathTestCase {
+ public static function getInfo() {
+ return array(
+ 'name' => 'User upgrade path (password token not involved)',
+ 'description' => 'User upgrade path tests (password token not involved).',
+ 'group' => 'Upgrade path',
+ );
+ }
+
+ public function setUp() {
+ // Path to the database dump files.
+ $this->databaseDumpFiles = array(
+ drupal_get_path('module', 'simpletest') . '/tests/upgrade/drupal-6.bare.database.php',
+ drupal_get_path('module', 'simpletest') . '/tests/upgrade/drupal-6.user-no-password-token.database.php',
+ );
+ parent::setUp();
+ }
+
+ /**
+ * Test a successful upgrade.
+ */
+ public function testUserUpgrade() {
+ $this->assertTrue($this->performUpgrade(), 'The upgrade was completed successfully.');
+ $this->assertEqual(variable_get('user_mail_register_no_approval_required_body'), '[user:name], [site:name], [site:url], [site:url-brief], [user:mail], [date:medium], [site:login-url], [user:edit-url], [user:one-time-login-url].', 'Existing email templates have been modified (password token not involved).');
+ }
+}