function ProjectInfoTest::providerGetInstallableReleases

Data provider for testGetInstallableReleases().

Return value

mixed[][] The test cases.

File

core/modules/package_manager/tests/src/Kernel/ProjectInfoTest.php, line 67

Class

ProjectInfoTest
@coversDefaultClass \Drupal\package_manager\ProjectInfo[[api-linebreak]] @group auto_updates @internal

Namespace

Drupal\Tests\package_manager\Kernel

Code

public static function providerGetInstallableReleases() : array {
  return [
    'core, no updates' => [
      'drupal.9.8.2.xml',
      '9.8.2',
      [],
    ],
    'core, on supported branch, pre-release in next minor' => [
      'drupal.9.8.0-alpha1.xml',
      '9.7.1',
      [
        '9.8.0-alpha1',
      ],
    ],
    'core, on unsupported branch, updates in multiple supported branches' => [
      'drupal.9.8.2.xml',
      '9.6.0-alpha1',
      [
        '9.8.2',
        '9.8.1',
        '9.8.0',
        '9.8.0-alpha1',
        '9.7.1',
        '9.7.0',
        '9.7.0-alpha1',
      ],
    ],
    // A test case with an unpublished release, 9.8.0, and unsupported
    // release, 9.8.1, both of these releases should not be returned.
'core, filter out unsupported and unpublished releases' => [
      'drupal.9.8.2-unsupported_unpublished.xml',
      '9.6.0-alpha1',
      [
        '9.8.2',
        '9.8.0-alpha1',
        '9.7.1',
        '9.7.0',
        '9.7.0-alpha1',
      ],
    ],
    'core, supported branches before and after installed release' => [
      'drupal.9.8.2.xml',
      '9.8.0-alpha1',
      [
        '9.8.2',
        '9.8.1',
        '9.8.0',
      ],
    ],
    'core, one insecure release filtered out' => [
      'drupal.9.8.1-security.xml',
      '9.8.0-alpha1',
      [
        '9.8.1',
      ],
    ],
    'core, skip insecure releases and return secure releases' => [
      'drupal.9.8.2-older-sec-release.xml',
      '9.7.0-alpha1',
      [
        '9.8.2',
        '9.8.1',
        '9.8.1-beta1',
        '9.8.0-alpha1',
        '9.7.1',
      ],
    ],
    'contrib, semver and legacy' => [
      'package_manager_test_update.7.0.1.xml',
      '8.x-6.0-alpha1',
      [
        '7.0.1',
        '7.0.0',
        '7.0.0-alpha1',
        '8.x-6.2',
        '8.x-6.1',
        '8.x-6.0',
      ],
    ],
    'contrib, semver and legacy, some lower' => [
      'package_manager_test_update.7.0.1.xml',
      '8.x-6.1',
      [
        '7.0.1',
        '7.0.0',
        '7.0.0-alpha1',
        '8.x-6.2',
      ],
    ],
    'contrib, semver and legacy, on semantic dev' => [
      'package_manager_test_update.7.0.1.xml',
      '7.0.x-dev',
      [
        '7.0.1',
        '7.0.0',
        '7.0.0-alpha1',
      ],
    ],
    'contrib, semver and legacy, on legacy dev' => [
      'package_manager_test_update.7.0.1.xml',
      '8.x-6.x-dev',
      [
        '7.0.1',
        '7.0.0',
        '7.0.0-alpha1',
        '8.x-6.2',
        '8.x-6.1',
        '8.x-6.0',
        '8.x-6.0-alpha1',
      ],
    ],
  ];
}

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