You are here

public function UpdateContribTest::securityUpdateAvailabilityProvider in Drupal 8

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

Data provider method for testSecurityUpdateAvailability().

These test cases rely on the following fixtures containing the following releases:

  • aaa_update_test.sec.8.x-1.2.xml

    • 8.x-1.2 Security update
    • 8.x-1.1 Insecure
    • 8.x-1.0 Insecure
  • aaa_update_test.sec.8.x-1.1_8.x-1.2.xml
    • 8.x-1.2 Security update
    • 8.x-1.1 Security update, Insecure
    • 8.x-1.0 Insecure
  • aaa_update_test.sec.8.x-1.2_8.x-2.2.xml
    • 8.x-3.0-beta2
    • 8.x-3.0-beta1 Insecure
    • 8.x-2.2 Security update
    • 8.x-2.1 Security update, Insecure
    • 8.x-2.0 Insecure
    • 8.x-1.2 Security update
    • 8.x-1.1 Insecure
    • 8.x-1.0 Insecure
  • aaa_update_test.sec.8.x-2.2_1.x_secure.xml
    • 8.x-2.2 Security update
    • 8.x-2.1 Security update, Insecure
    • 8.x-2.0 Insecure
    • 8.x-1.2
    • 8.x-1.1
    • 8.x-1.0

File

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

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 securityUpdateAvailabilityProvider() {
  return [
    // Security releases available for module major release 1.
    // No releases for next major.
    '8.x-1.0, 8.x-1.2' => [
      'module_patch_version' => '8.x-1.0',
      'expected_security_releases' => [
        '8.x-1.2',
      ],
      'expected_update_message_type' => static::SECURITY_UPDATE_REQUIRED,
      'fixture' => 'sec.8.x-1.2',
    ],
    // Two security releases available for module major release 1.
    // 8.x-1.1 security release marked as insecure.
    // No releases for next major.
    '8.x-1.0, 8.x-1.1 8.x-1.2' => [
      'module_patch_version' => '8.x-1.0',
      'expected_security_releases' => [
        '8.x-1.2',
      ],
      'expected_update_message_type' => static::SECURITY_UPDATE_REQUIRED,
      'fixture' => 'sec.8.x-1.1_8.x-1.2',
    ],
    // Security release available for module major release 2.
    // No releases for next major.
    '8.x-2.0, 8.x-2.2' => [
      'module_patch_version' => '8.x-2.0',
      'expected_security_releases' => [
        '8.x-2.2',
      ],
      'expected_update_message_type' => static::SECURITY_UPDATE_REQUIRED,
      'fixture' => 'sec.8.x-2.2_1.x_secure',
    ],
    '8.x-2.2, 8.x-1.2 8.x-2.2' => [
      'module_patch_version' => '8.x-2.2',
      'expected_security_releases' => [],
      'expected_update_message_type' => static::UPDATE_NONE,
      'fixture' => 'sec.8.x-1.2_8.x-2.2',
    ],
    // Security release available for module major release 1.
    // Security release also available for next major.
    '8.x-1.0, 8.x-1.2 8.x-2.2' => [
      'module_patch_version' => '8.x-1.0',
      'expected_security_releases' => [
        '8.x-1.2',
      ],
      'expected_update_message_type' => static::SECURITY_UPDATE_REQUIRED,
      'fixture' => 'sec.8.x-1.2_8.x-2.2',
    ],
    // No security release available for module major release 1 but 1.x
    // releases are not marked as insecure.
    // Security release available for next major.
    '8.x-1.0, 8.x-2.2, not insecure' => [
      'module_patch_version' => '8.x-1.0',
      'expected_security_releases' => [],
      'expected_update_message_type' => static::UPDATE_AVAILABLE,
      'fixture' => 'sec.8.x-2.2_1.x_secure',
    ],
    // On latest security release for module major release 1.
    // Security release also available for next major.
    '8.x-1.2, 8.x-1.2 8.x-2.2' => [
      'module_patch_version' => '8.x-1.2',
      'expected_security_release' => [],
      'expected_update_message_type' => static::UPDATE_NONE,
      'fixture' => 'sec.8.x-1.2_8.x-2.2',
    ],
    '8.x-2.0, 8.x-1.2 8.x-2.2' => [
      'module_patch_version' => '8.x-2.0',
      'expected_security_releases' => [
        '8.x-2.2',
      ],
      'expected_update_message_type' => static::SECURITY_UPDATE_REQUIRED,
      'fixture' => 'sec.8.x-1.2_8.x-2.2',
    ],
  ];
}