function UpdateContribTest::testSecurityUpdateAvailability

Same name in other branches
  1. 8.9.x 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()
  3. 11.x 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 630

Class

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

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)');
}

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