function UpdateContribTest::testUnsupportedRelease

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

Tests messages when a project release is marked unsupported.

This test confirms unsupported 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.1' release that has the 'Release type' value of 'unsupported' and an '8.x-2.0' release that has the 'Release type' value of 'supported' and is the expected update.

File

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

Class

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

Namespace

Drupal\Tests\update\Functional

Code

public function testUnsupportedRelease() : void {
  $this->mockInstalledExtensionsInfo([
    'aaa_update_test' => [
      'project' => 'aaa_update_test',
      'version' => '8.x-1.1',
      'hidden' => FALSE,
    ],
  ]);
  $this->refreshUpdateStatus([
    'drupal' => '8.0.0',
    $this->updateProject => '1_0-supported',
  ]);
  // @todo Change the version label to 'Recommended version:' in
  // https://www.drupal.org/node/3114408.
  $this->confirmUnsupportedStatus('8.x-1.1', '8.x-2.0', 'Also available:');
  $this->refreshUpdateStatus([
    'drupal' => '8.0.0',
    $this->updateProject => '1_0-unsupported',
  ]);
  $this->confirmUnsupportedStatus('8.x-1.1', '8.x-2.0', 'Recommended version:');
}

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