You are here

function UpdateScriptFunctionalTest::testNoUpdateFunctionality in Drupal 7

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

File

modules/system/system.test, line 2574
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);
}