function UpdateScriptTest::testNoUpdateFunctionality

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

File

drupal/core/modules/system/lib/Drupal/system/Tests/Update/UpdateScriptTest.php, line 141
Definition of Drupal\system\Tests\Update\UpdateScriptTest.

Class

UpdateScriptTest
Tests the update system functionality.

Namespace

Drupal\system\Tests\Update

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