function InfoParserUnitTest::providerCoreIncompatibility

Same name in other branches
  1. 9 core/tests/Drupal/Tests/Core/Extension/InfoParserUnitTest.php \Drupal\Tests\Core\Extension\InfoParserUnitTest::providerCoreIncompatibility()
  2. 10 core/tests/Drupal/Tests/Core/Extension/InfoParserUnitTest.php \Drupal\Tests\Core\Extension\InfoParserUnitTest::providerCoreIncompatibility()
  3. 11.x core/tests/Drupal/Tests/Core/Extension/InfoParserUnitTest.php \Drupal\Tests\Core\Extension\InfoParserUnitTest::providerCoreIncompatibility()

Dataprovider for testCoreIncompatibility().

File

core/tests/Drupal/Tests/Core/Extension/InfoParserUnitTest.php, line 460

Class

InfoParserUnitTest
Tests InfoParser class and exception.

Namespace

Drupal\Tests\Core\Extension

Code

public function providerCoreIncompatibility() {
    list($major, $minor) = explode('.', \Drupal::VERSION);
    $next_minor = $minor + 1;
    $next_major = $major + 1;
    return [
        'next_minor' => [
            'next_minor',
            "^{$major}.{$next_minor}",
            TRUE,
        ],
        'current_major_next_major' => [
            'current_major_next_major',
            "^{$major} || ^{$next_major}",
            FALSE,
        ],
        'previous_major_next_major' => [
            'previous_major_next_major',
            "^1 || ^{$next_major}",
            TRUE,
        ],
        'current_minor' => [
            'current_minor',
            "~{$major}.{$minor}",
            FALSE,
        ],
    ];
}

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