You are here

public function InfoParserUnitTest::providerCoreIncompatibility in Drupal 8

Same name and namespace in other branches
  1. 9 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,
    ],
  ];
}