diff options
Diffstat (limited to 'modules')
-rw-r--r-- | modules/simpletest/tests/upgrade/upgrade.test | 8 |
1 files changed, 6 insertions, 2 deletions
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); |