function system_test_system_info_alter
Same name in other branches
- 7.x modules/simpletest/tests/system_test.module \system_test_system_info_alter()
- 9 core/modules/system/tests/modules/system_test/system_test.module \system_test_system_info_alter()
- 8.9.x core/modules/system/tests/modules/system_test/system_test.module \system_test_system_info_alter()
- 11.x core/modules/system/tests/modules/system_test/system_test.module \system_test_system_info_alter()
Implements hook_system_info_alter().
File
-
core/
modules/ system/ tests/ modules/ system_test/ system_test.module, line 57
Code
function system_test_system_info_alter(&$info, Extension $file, $type) {
// We need a static otherwise the last test will fail to alter common_test.
static $test;
if (($dependencies = \Drupal::state()->get('system_test.dependencies')) || $test) {
if ($file->getName() == 'module_test') {
$info['hidden'] = FALSE;
$info['dependencies'][] = array_shift($dependencies);
\Drupal::state()->set('system_test.dependencies', $dependencies);
$test = TRUE;
}
if ($file->getName() == 'common_test') {
$info['hidden'] = FALSE;
$info['version'] = '8.x-2.4-beta3';
}
}
// Make the system_dependencies_test visible by default.
if ($file->getName() == 'system_dependencies_test') {
$info['hidden'] = FALSE;
}
if (in_array($file->getName(), [
'system_incompatible_module_version_dependencies_test',
'system_incompatible_core_version_dependencies_test',
'system_incompatible_module_version_test',
])) {
$info['hidden'] = FALSE;
}
if ($file->getName() == 'requirements1_test' || $file->getName() == 'requirements2_test') {
$info['hidden'] = FALSE;
}
if ($file->getName() == 'system_test') {
$info['hidden'] = \Drupal::state()->get('system_test.module_hidden', TRUE);
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.