function UpdateTestBase::confirmUnsupportedStatus

Same name in other branches
  1. 9 core/modules/update/tests/src/Functional/UpdateTestBase.php \Drupal\Tests\update\Functional\UpdateTestBase::confirmUnsupportedStatus()
  2. 8.9.x core/modules/update/tests/src/Functional/UpdateTestBase.php \Drupal\Tests\update\Functional\UpdateTestBase::confirmUnsupportedStatus()
  3. 11.x core/modules/update/tests/src/Functional/UpdateTestBase.php \Drupal\Tests\update\Functional\UpdateTestBase::confirmUnsupportedStatus()

Confirms messages are correct when a release has been marked unsupported.

Parameters

string $unsupported_version: The unsupported version that is currently installed.

string|null $newer_version: (optional) The expected newer version to recommend.

string|null $new_version_label: (optional) The expected label for the newer version. For example 'Recommended version:' or 'Also available:'.

1 call to UpdateTestBase::confirmUnsupportedStatus()
UpdateContribTest::testUnsupportedRelease in core/modules/update/tests/src/Functional/UpdateContribTest.php
Tests messages when a project release is marked unsupported.

File

core/modules/update/tests/src/Functional/UpdateTestBase.php, line 218

Class

UpdateTestBase
Defines some shared functions used by all update tests.

Namespace

Drupal\Tests\update\Functional

Code

protected function confirmUnsupportedStatus(string $unsupported_version, ?string $newer_version = NULL, ?string $new_version_label = NULL) {
    $this->drupalGet('admin/reports/updates');
    $this->clickLink('Check manually');
    $this->checkForMetaRefresh();
    $this->assertUpdateTableTextContains('Not supported!');
    $this->assertUpdateTableTextContains($unsupported_version);
    $this->assertUpdateTableElementContains('error.svg');
    if ($newer_version === NULL) {
        $this->assertUpdateTableTextContains('Release not supported: Your currently installed release is now unsupported, is no longer available for download and no update is available. Uninstalling everything included in this release is strongly recommended!');
        $this->assertUpdateTableTextNotContains('Recommended version');
    }
    else {
        $this->assertNotEmpty($newer_version);
        $this->assertUpdateTableTextContains('Release not supported: Your currently installed release is now unsupported, and is no longer available for download. Uninstalling everything included in this release or upgrading is strongly recommended!');
        $this->assertVersionUpdateLinks($new_version_label, $newer_version);
    }
}

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