dependency_version_test.module

Same filename in other branches
  1. 10 core/modules/system/tests/modules/dependency_version_test/dependency_version_test.module
  2. 11.x core/modules/system/tests/modules/dependency_version_test/dependency_version_test.module

Module for testing the dependency version comparisons.

File

core/modules/system/tests/modules/dependency_version_test/dependency_version_test.module

View source
<?php


/**
 * @file
 * Module for testing the dependency version comparisons.
 */
use Drupal\Core\Extension\Extension;

/**
 * Implements hook_system_info_alter().
 */
function dependency_version_test_system_info_alter(&$info, Extension $file, $type) {
    // Simulate that the core version for Views module contains the string '8.x'.
    if ($file->getName() == 'views') {
        $info['version'] = '9.8.x-dev';
    }
    // Make the test_module require Views 9.2, which should be compatible with
    // core version 9.8.x-dev from above.
    if ($file->getName() == 'test_module') {
        $info['dependencies'] = [
            'drupal:views (>=9.2)',
        ];
    }
}

Functions

Title Deprecated Summary
dependency_version_test_system_info_alter Implements hook_system_info_alter().

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.