You are here

public function UpdateScriptTest::providerExtensionCompatibilityChange in Drupal 9

Same name and namespace in other branches
  1. 8 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 276

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_version_requirement key incompatible' => [
      [
        'core_version_requirement' => '^8 || ^9',
        'type' => 'module',
      ],
      [
        'core_version_requirement' => '8.7.7',
        'type' => 'module',
      ],
      $incompatible_module_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() . ":",
    ],
    'module: core_version_requirement key missing' => [
      [
        'core_version_requirement' => '^8 || ^9',
        'type' => 'module',
      ],
      [
        'core' => '8.x',
        'type' => 'module',
      ],
      $incompatible_module_message,
    ],
    'theme: core_version_requirement key missing' => [
      [
        'core_version_requirement' => '^8 || ^9',
        'type' => 'theme',
      ],
      [
        'core' => '8.x',
        'type' => 'theme',
      ],
      $incompatible_theme_message,
    ],
  ];
}