From 104d6197a8affe1bfdbe6565686aabf531bd455b Mon Sep 17 00:00:00 2001 From: Angie Byron Date: Sat, 18 Dec 2010 06:36:00 +0000 Subject: #945112 by carlos8f, dalin, David_Rothstein: Fixed Unable to stay logged in during upgrade from D6 -> D7 --- modules/simpletest/tests/upgrade/upgrade.test | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'modules/simpletest/tests') diff --git a/modules/simpletest/tests/upgrade/upgrade.test b/modules/simpletest/tests/upgrade/upgrade.test index 8ea93deba..0b48db507 100644 --- a/modules/simpletest/tests/upgrade/upgrade.test +++ b/modules/simpletest/tests/upgrade/upgrade.test @@ -34,6 +34,9 @@ abstract class UpgradePathTestCase extends DrupalWebTestCase { protected function setUp() { global $user, $language, $conf; + // Load the Update API. + require_once DRUPAL_ROOT . '/includes/update.inc'; + // Reset flags. $this->upgradedSite = FALSE; $this->upgradeErrors = array(); @@ -106,10 +109,11 @@ abstract class UpgradePathTestCase extends DrupalWebTestCase { drupal_save_session(FALSE); $user = db_query('SELECT * FROM {users} WHERE uid = :uid', array(':uid' => 1))->fetchObject(); - // Generate and set a session cookie. + // Generate and set a D6-compatible session cookie. $this->curlInitialize(); $sid = drupal_hash_base64(uniqid(mt_rand(), TRUE) . drupal_random_bytes(55)); - curl_setopt($this->curlHandle, CURLOPT_COOKIE, rawurlencode($this->session_name) . '=' . rawurlencode($sid)); + $session_name = update_get_d6_session_name(); + curl_setopt($this->curlHandle, CURLOPT_COOKIE, rawurlencode($session_name) . '=' . rawurlencode($sid)); // Force our way into the session of the child site. drupal_save_session(TRUE); -- cgit v1.2.3