Same name and namespace in other branches
  1. 8.9.x core/modules/system/tests/modules/common_test/common_test.module \common_test_library_info_alter()
  2. 9 core/modules/system/tests/modules/common_test/common_test.module \common_test_library_info_alter()

Implements hook_library_info_alter().

File

core/modules/system/tests/modules/common_test/common_test.module, line 165
Helper module for the Common tests.

Code

function common_test_library_info_alter(&$libraries, $module) {
  if ($module === 'core' && isset($libraries['loadjs'])) {

    // Change the version of loadjs to 0.0.
    $libraries['loadjs']['version'] = '0.0';

    // Make loadjs depend on jQuery Form to test library dependencies.
    $libraries['loadjs']['dependencies'][] = 'core/internal.jquery.form';
  }

  // Alter the dynamically registered library definition.
  if ($module === 'common_test' && isset($libraries['dynamic_library'])) {
    $libraries['dynamic_library']['dependencies'] = [
      'core/jquery',
    ];
  }
}