public function BasicUpgradePath::testBasicUpgrade

7.x upgrade.test public BasicUpgradePath::testBasicUpgrade()

Test a successful upgrade.


drupal/modules/simpletest/tests/upgrade/upgrade.test, line 367


Perform basic upgrade tests.


public function testBasicUpgrade() {
  $this->assertTrue($this->performUpgrade(), 'The upgrade was completed successfully.');

  // Hit the frontpage.

  // Verify that we are still logged in.
  $this->assertEqual($this->getUrl(), url('user/1/edit', array('absolute' => TRUE)), 'We are still logged in as admin at the end of the upgrade.');

  // Logout and verify that we can login back in with our initial password.
  $this->drupalLogin((object) array(
    'uid' => 1,
    'name' => 'admin',
    'pass_raw' => 'admin',

  // The previous login should've triggered a password rehash, so login one
  // more time to make sure the new hash is readable.
  $this->drupalLogin((object) array(
    'uid' => 1,
    'name' => 'admin',
    'pass_raw' => 'admin',

  // Test that the site name is correctly displayed.
  $this->assertText('Drupal 6', 'The site name is correctly displayed.');

  // Verify that the main admin sections are available.

  // Confirm that no {menu_links} entry exists for user/autocomplete.
  $result = db_query('SELECT COUNT(*) FROM {menu_links} WHERE link_path = :user_autocomplete', array(':user_autocomplete' => 'user/autocomplete'))->fetchField();
  $this->assertFalse($result, 'No {menu_links} entry exists for user/autocomplete');

  // Test that the environment after the upgrade is in a consistent status.
  $update_d6 = variable_get('update_d6', FALSE);
  $this->assertFalse($update_d6, 'The D6 upgrade flag variable has been correctly disabled.');