function update_script_test_requirements
Same name in other branches
- 7.x modules/simpletest/tests/update_script_test.install \update_script_test_requirements()
- 9 core/modules/system/tests/modules/update_script_test/update_script_test.install \update_script_test_requirements()
- 8.9.x core/modules/system/tests/modules/update_script_test/update_script_test.install \update_script_test_requirements()
- 11.x core/modules/system/tests/modules/update_script_test/update_script_test.install \update_script_test_requirements()
Implements hook_requirements().
File
-
core/
modules/ system/ tests/ modules/ update_script_test/ update_script_test.install, line 11
Code
function update_script_test_requirements($phase) {
$requirements = [];
if ($phase == 'update') {
// Set a requirements warning or error when the test requests it.
$requirement_type = \Drupal::config('update_script_test.settings')->get('requirement_type');
switch ($requirement_type) {
case REQUIREMENT_WARNING:
$requirements['update_script_test'] = [
'title' => 'Update script test',
'value' => 'Warning',
'description' => 'This is a requirements warning provided by the update_script_test module.',
'severity' => REQUIREMENT_WARNING,
];
break;
case REQUIREMENT_ERROR:
$requirements['update_script_test'] = [
'title' => 'Update script test',
'value' => 'Error',
'description' => 'This is a (buggy description fixed in update_script_test_requirements_alter()) requirements error provided by the update_script_test module.',
'severity' => REQUIREMENT_ERROR,
];
break;
}
}
return $requirements;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.