update_script_test.module in Drupal 8
Same filename and directory in other branches
This file provides testing functionality for update.php.
File
core/modules/system/tests/modules/update_script_test/update_script_test.moduleView source
<?php
/**
* @file
* This file provides testing functionality for update.php.
*/
use Drupal\Core\Extension\Extension;
/**
* Implements hook_cache_flush().
*
* This sets a message to confirm that all caches are cleared whenever
* update.php completes.
*
* @see UpdateScriptFunctionalTest::testRequirements()
*/
function update_script_test_cache_flush() {
\Drupal::messenger()
->addStatus(t('hook_cache_flush() invoked for update_script_test.module.'));
}
/**
* Implements hook_system_info_alter().
*/
function update_script_test_system_info_alter(array &$info, Extension $file, $type) {
$new_info = \Drupal::state()
->get('update_script_test.system_info_alter');
if ($new_info) {
if ($file
->getName() == 'update_script_test') {
$info = $new_info + $info;
}
}
}
Functions
Name | Description |
---|---|
update_script_test_cache_flush | Implements hook_cache_flush(). |
update_script_test_system_info_alter | Implements hook_system_info_alter(). |