function UpdateScriptFunctionalTest::testNoUpdateFunctionality

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

File

modules/system/system.test, line 2645

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);
}

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