function DependencyTest::testIncompatibleModuleVersionDependency

Same name in other branches
  1. 9 core/modules/system/tests/src/Functional/Module/DependencyTest.php \Drupal\Tests\system\Functional\Module\DependencyTest::testIncompatibleModuleVersionDependency()
  2. 10 core/modules/system/tests/src/Functional/Module/DependencyTest.php \Drupal\Tests\system\Functional\Module\DependencyTest::testIncompatibleModuleVersionDependency()
  3. 11.x core/modules/system/tests/src/Functional/Module/DependencyTest.php \Drupal\Tests\system\Functional\Module\DependencyTest::testIncompatibleModuleVersionDependency()

Tests enabling a module that depends on an incompatible version of a module.

File

core/modules/system/tests/src/Functional/Module/DependencyTest.php, line 74

Class

DependencyTest
Enable module without dependency enabled.

Namespace

Drupal\Tests\system\Functional\Module

Code

public function testIncompatibleModuleVersionDependency() {
    // Test that the system_incompatible_module_version_dependencies_test is
    // marked as having an incompatible dependency.
    $this->drupalGet('admin/modules');
    $this->assertRaw(t('@module (<span class="admin-missing">incompatible with</span> version @version)', [
        '@module' => 'System incompatible module version test (>2.0)',
        '@version' => '1.0',
    ]), 'A module that depends on an incompatible version of a module is marked as such.');
    $checkbox = $this->xpath('//input[@type="checkbox" and @disabled="disabled" and @name="modules[system_incompatible_module_version_dependencies_test][enable]"]');
    $this->assertCount(1, $checkbox, 'Checkbox for the module is disabled.');
}

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