You are here

public function UpdateScriptTest::providerExtensionCompatibilityChange in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/system/tests/src/Functional/UpdateSystem/UpdateScriptTest.php \Drupal\Tests\system\Functional\UpdateSystem\UpdateScriptTest::providerExtensionCompatibilityChange()
  2. 10 core/modules/system/tests/src/Functional/UpdateSystem/UpdateScriptTest.php \Drupal\Tests\system\Functional\UpdateSystem\UpdateScriptTest::providerExtensionCompatibilityChange()

Date provider for testExtensionCompatibilityChange().

File

core/modules/system/tests/src/Functional/UpdateSystem/UpdateScriptTest.php, line 274

Class

UpdateScriptTest
Tests the update script access and functionality.

Namespace

Drupal\Tests\system\Functional\UpdateSystem

Code

public function providerExtensionCompatibilityChange() {
  $incompatible_module_message = "The following module is installed, but it is incompatible with Drupal " . \Drupal::VERSION . ":";
  $incompatible_theme_message = "The following theme is installed, but it is incompatible with Drupal " . \Drupal::VERSION . ":";
  return [
    'module: core key incompatible' => [
      [
        'core_version_requirement' => '^8 || ^9',
        'type' => 'module',
      ],
      [
        'core' => '7.x',
        'type' => 'module',
      ],
      $incompatible_module_message,
    ],
    'module: core_version_requirement key incompatible' => [
      [
        'core_version_requirement' => '^8 || ^9',
        'type' => 'module',
      ],
      [
        'core_version_requirement' => '8.7.7',
        'type' => 'module',
      ],
      $incompatible_module_message,
    ],
    'theme: core key incompatible' => [
      [
        'core_version_requirement' => '^8 || ^9',
        'type' => 'theme',
      ],
      [
        'core' => '7.x',
        'type' => 'theme',
      ],
      $incompatible_theme_message,
    ],
    'theme: core_version_requirement key incompatible' => [
      [
        'core_version_requirement' => '^8 || ^9',
        'type' => 'theme',
      ],
      [
        'core_version_requirement' => '8.7.7',
        'type' => 'theme',
      ],
      $incompatible_theme_message,
    ],
    'module: php requirement' => [
      [
        'core_version_requirement' => '^8 || ^9',
        'type' => 'module',
        'php' => 1,
      ],
      [
        'core_version_requirement' => '^8 || ^9',
        'type' => 'module',
        'php' => 1000000000,
      ],
      'The following module is installed, but it is incompatible with PHP ' . phpversion() . ":",
    ],
    'theme: php requirement' => [
      [
        'core_version_requirement' => '^8 || ^9',
        'type' => 'theme',
        'php' => 1,
      ],
      [
        'core_version_requirement' => '^8 || ^9',
        'type' => 'theme',
        'php' => 1000000000,
      ],
      'The following theme is installed, but it is incompatible with PHP ' . phpversion() . ":",
    ],
  ];
}