function UpdateContribTest::testRevokedRelease

Same name in other branches
  1. 8.9.x core/modules/update/tests/src/Functional/UpdateContribTest.php \Drupal\Tests\update\Functional\UpdateContribTest::testRevokedRelease()
  2. 10 core/modules/update/tests/src/Functional/UpdateContribTest.php \Drupal\Tests\update\Functional\UpdateContribTest::testRevokedRelease()
  3. 11.x core/modules/update/tests/src/Functional/UpdateContribTest.php \Drupal\Tests\update\Functional\UpdateContribTest::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:

  • aaa_update_test.1_0-supported.xml 'supported_branches' is '8.x-1.,8.x-2.'.
  • aaa_update_test.1_0-unsupported.xml 'supported_branches' is '8.x-2.'.

They both have an '8.x-1.0' release that is unpublished and an '8.x-2.0' release that is published and is the expected update.

File

core/modules/update/tests/src/Functional/UpdateContribTest.php, line 760

Class

UpdateContribTest
Tests how the Update Manager handles contributed modules and themes.

Namespace

Drupal\Tests\update\Functional

Code

public function testRevokedRelease() {
    $system_info = [
        'aaa_update_test' => [
            'project' => 'aaa_update_test',
            'version' => '8.x-1.0',
            'hidden' => FALSE,
        ],
    ];
    $this->config('update_test.settings')
        ->set('system_info', $system_info)
        ->save();
    $this->refreshUpdateStatus([
        'drupal' => '0.0',
        $this->updateProject => '1_0-supported',
    ]);
    // @todo Change the version label to 'Recommended version:' in
    // https://www.drupal.org/node/3114408.
    $this->confirmRevokedStatus('8.x-1.0', '8.x-2.0', 'Also available:');
    $this->refreshUpdateStatus([
        'drupal' => '0.0',
        $this->updateProject => '1_0-unsupported',
    ]);
    $this->confirmRevokedStatus('8.x-1.0', '8.x-2.0', 'Recommended version:');
}

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