function ProjectCoreCompatibilityTest::providerIsCoreCompatible

Same name in other branches
  1. 10 core/modules/update/tests/src/Unit/ProjectCoreCompatibilityTest.php \Drupal\Tests\update\Unit\ProjectCoreCompatibilityTest::providerIsCoreCompatible()

Data provider for testIsCoreCompatible().

File

core/modules/update/tests/src/Unit/ProjectCoreCompatibilityTest.php, line 182

Class

ProjectCoreCompatibilityTest
@coversDefaultClass \Drupal\update\ProjectCoreCompatibility

Namespace

Drupal\Tests\update\Unit

Code

public static function providerIsCoreCompatible() : array {
    $test_cases['compatible exact'] = [
        '10.3.0',
        '10.3.0',
        TRUE,
    ];
    $test_cases['compatible with OR'] = [
        '^9 || ^10',
        '10.3.0',
        TRUE,
    ];
    $test_cases['incompatible'] = [
        '^10',
        '11.0.0',
        FALSE,
    ];
    $test_cases['broken'] = [
        '^^11',
        '11.0.0',
        FALSE,
    ];
    return $test_cases;
}

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