You are here

experimental_module_requirements_test.install in Drupal 9

Experimental Test Requirements module to test hook_requirements().

File

core/modules/system/tests/modules/experimental_module_requirements_test/experimental_module_requirements_test.install
View source
<?php

/**
 * @file
 * Experimental Test Requirements module to test hook_requirements().
 */

/**
 * Implements hook_requirements().
 */
function experimental_module_requirements_test_requirements() {
  $requirements = [];
  if (\Drupal::state()
    ->get('experimental_module_requirements_test_requirements', FALSE)) {
    $requirements['experimental_module_requirements_test_requirements'] = [
      'severity' => REQUIREMENT_ERROR,
      'description' => t('The Experimental Test Requirements module can not be installed.'),
    ];
  }
  return $requirements;
}