You are here

function UpdateCoreTest::testSecurityUpdateAvailable in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/update/src/Tests/UpdateCoreTest.php \Drupal\update\Tests\UpdateCoreTest::testSecurityUpdateAvailable()

Tests the Update Manager module when a security update is available.

File

core/modules/update/src/Tests/UpdateCoreTest.php, line 157
Contains \Drupal\update\Tests\UpdateCoreTest.

Class

UpdateCoreTest
Tests the Update Manager module through a series of functional tests using mock XML data.

Namespace

Drupal\update\Tests

Code

function testSecurityUpdateAvailable() {
  foreach (array(
    0,
    1,
  ) as $minor_version) {
    $this
      ->setSystemInfo("8.{$minor_version}.0");
    $this
      ->refreshUpdateStatus(array(
      'drupal' => "{$minor_version}.2-sec",
    ));
    $this
      ->standardTests();
    $this
      ->assertNoText(t('Up to date'));
    $this
      ->assertNoText(t('Update available'));
    $this
      ->assertText(t('Security update required!'));
    $this
      ->assertRaw(\Drupal::l("8.{$minor_version}.2", Url::fromUri("http://example.com/drupal-8-{$minor_version}-2-release")), 'Link to release appears.');
    $this
      ->assertRaw(\Drupal::l(t('Download'), Url::fromUri("http://example.com/drupal-8-{$minor_version}-2.tar.gz")), 'Link to download appears.');
    $this
      ->assertRaw(\Drupal::l(t('Release notes'), Url::fromUri("http://example.com/drupal-8-{$minor_version}-2-release")), 'Link to release notes appears.');
    $this
      ->assertRaw('error.svg', 'Error icon was found.');
  }
}