function BasicUpgradePath::testFailedUpgrade

Test a failed upgrade, and verify that the failure is reported.

File

modules/simpletest/tests/upgrade/upgrade.test, line 364

Class

BasicUpgradePath
Perform basic upgrade tests.

Code

public function testFailedUpgrade() {
  if ($this->skipUpgradeTest) {
    return;
  }
  // Destroy a table that the upgrade process needs.
  db_drop_table('access');
  // Assert that the upgrade fails.
  $this->assertFalse($this->performUpgrade(FALSE) && $this->pendingUpdates, 'A failed upgrade should return messages.');
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.