You are here

public function InfoParserUnitTest::providerCoreIncompatibility in Drupal 10

Same name and namespace in other branches
  1. 8 core/tests/Drupal/Tests/Core/Extension/InfoParserUnitTest.php \Drupal\Tests\Core\Extension\InfoParserUnitTest::providerCoreIncompatibility()
  2. 9 core/tests/Drupal/Tests/Core/Extension/InfoParserUnitTest.php \Drupal\Tests\Core\Extension\InfoParserUnitTest::providerCoreIncompatibility()

Data provider for testCoreIncompatibility().

File

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

Class

InfoParserUnitTest
Tests InfoParser class and exception.

Namespace

Drupal\Tests\Core\Extension

Code

public function providerCoreIncompatibility() {
  [
    $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,
    ],
  ];
}