You are here

public function UpdateContribTest::testSecurityUpdateAvailability in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/update/tests/src/Functional/UpdateContribTest.php \Drupal\Tests\update\Functional\UpdateContribTest::testSecurityUpdateAvailability()
  2. 10 core/modules/update/tests/src/Functional/UpdateContribTest.php \Drupal\Tests\update\Functional\UpdateContribTest::testSecurityUpdateAvailability()

Tests update status of security releases.

@dataProvider securityUpdateAvailabilityProvider

Parameters

string $module_version: The module version the site is using.

string[] $expected_security_releases: The security releases, if any, that the status report should recommend.

string $expected_update_message_type: The type of update message expected.

string $fixture: The fixture file to use.

File

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

Class

UpdateContribTest
Tests how the Update Manager module handles contributed modules and themes in a series of functional tests using mock XML data.

Namespace

Drupal\Tests\update\Functional

Code

public function testSecurityUpdateAvailability($module_version, array $expected_security_releases, $expected_update_message_type, $fixture) {
  $system_info = [
    '#all' => [
      'version' => '8.0.0',
    ],
    'aaa_update_test' => [
      'project' => 'aaa_update_test',
      'version' => $module_version,
      'hidden' => FALSE,
    ],
  ];
  $this
    ->config('update_test.settings')
    ->set('system_info', $system_info)
    ->save();
  $this
    ->refreshUpdateStatus([
    'drupal' => '0.0',
    'aaa_update_test' => $fixture,
  ]);
  $this
    ->assertSecurityUpdates('aaa_update_test', $expected_security_releases, $expected_update_message_type, 'table.update:nth-of-type(2)');
}