function UpdateScriptFunctionalTest::testNoUpdateFunctionality

7.x system.test UpdateScriptFunctionalTest::testNoUpdateFunctionality()

Tests update.php when there are no updates to apply.

File

drupal-7.x/modules/system/system.test, line 2318
Tests for system.module.

Class

UpdateScriptFunctionalTest
Tests for the update system functionality.

Code

function testNoUpdateFunctionality() {
  // Click through update.php with 'administer software updates' permission.
  $this->drupalLogin($this->update_user);
  $this->drupalPost($this->update_url, array(), t('Continue'), array('external' => TRUE));
  $this->assertText(t('No pending updates.'));
  $this->assertNoLink('Administration pages');
  $this->clickLink('Front page');
  $this->assertResponse(200);

  // Click through update.php with 'access administration pages' permission.
  $admin_user = $this->drupalCreateUser(array('administer software updates', 'access administration pages'));
  $this->drupalLogin($admin_user);
  $this->drupalPost($this->update_url, array(), t('Continue'), array('external' => TRUE));
  $this->assertText(t('No pending updates.'));
  $this->clickLink('Administration pages');
  $this->assertResponse(200);
}