function EnabledExtensionsValidatorTest::providerExtensionRemoved

Data provider for testExtensionRemoved().

Return value

mixed[][] The test cases.

File

core/modules/package_manager/tests/src/Kernel/EnabledExtensionsValidatorTest.php, line 29

Class

EnabledExtensionsValidatorTest
@covers \Drupal\package_manager\Validator\EnabledExtensionsValidator[[api-linebreak]] @group package_manager @internal

Namespace

Drupal\Tests\package_manager\Kernel

Code

public static function providerExtensionRemoved() : array {
  $summary = t('The update cannot proceed because the following enabled Drupal extension was removed during the update.');
  return [
    'module' => [
      [
        [
          'name' => 'drupal/test_module2',
          'version' => '1.3.1',
          'type' => 'drupal-module',
        ],
      ],
      [
        ValidationResult::createError([
          t("'test_module2' module (provided by <code>drupal/test_module2</code>)"),
        ], $summary),
      ],
    ],
    'module and theme' => [
      [
        [
          'name' => 'drupal/test_module1',
          'version' => '1.3.1',
          'type' => 'drupal-module',
        ],
        [
          'name' => 'drupal/test_theme',
          'version' => '1.3.1',
          'type' => 'drupal-theme',
        ],
      ],
      [
        ValidationResult::createError([
          t("'test_module1' module (provided by <code>drupal/test_module1</code>)"),
          t("'test_theme' theme (provided by <code>drupal/test_theme</code>)"),
        ], t('The update cannot proceed because the following enabled Drupal extensions were removed during the update.')),
      ],
    ],
    'profile' => [
      [
        [
          'name' => 'drupal/test_profile',
          'version' => '1.3.1',
          'type' => 'drupal-profile',
        ],
      ],
      [
        ValidationResult::createError([
          t("'test_profile' profile (provided by <code>drupal/test_profile</code>)"),
        ], $summary),
      ],
    ],
    'theme' => [
      [
        [
          'name' => 'drupal/test_theme',
          'version' => '1.3.1',
          'type' => 'drupal-theme',
        ],
      ],
      [
        ValidationResult::createError([
          t("'test_theme' theme (provided by <code>drupal/test_theme</code>)"),
        ], $summary),
      ],
    ],
  ];
}

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