function UpdateSemverTestBaselineTrait::testRevokedRelease

Same name in other branches
  1. 10 core/modules/update/tests/src/Functional/UpdateSemverTestBaselineTrait.php \Drupal\Tests\update\Functional\UpdateSemverTestBaselineTrait::testRevokedRelease()

Tests messages when a project release is unpublished.

This test confirms that revoked messages are displayed regardless of whether the installed version is in a supported branch or not. This test relies on 2 test XML fixtures that are identical except for the 'supported_branches' value:

  • [::$updateProject].8.1.0.xml 'supported_branches' is '8.0.,8.1.'.
  • [::$updateProject].8.1.0-unsupported.xml 'supported_branches' is '8.1.'.

They both have an '8.0.2' release that is unpublished and an '8.1.0' release that is published and is the expected update.

File

core/modules/update/tests/src/Functional/UpdateSemverTestBaselineTrait.php, line 235

Class

UpdateSemverTestBaselineTrait
Provides test methods for semver tests shared between core and contrib.

Namespace

Drupal\Tests\update\Functional

Code

public function testRevokedRelease() : void {
    foreach ([
        '8.1.0',
        '8.1.0-unsupported',
    ] as $fixture) {
        $this->setProjectInstalledVersion('8.0.2');
        $this->refreshUpdateStatus([
            $this->updateProject => $fixture,
        ]);
        $this->standardTests();
        $this->confirmRevokedStatus('8.0.2', '8.1.0', 'Recommended version:');
    }
}

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