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. 8.9.x core/modules/system/tests/src/Functional/Module/DependencyTest.php \Drupal\Tests\system\Functional\Module\DependencyTest::testIncompatibleModuleVersionDependency()
  3. 10 core/modules/system/tests/src/Functional/Module/DependencyTest.php \Drupal\Tests\system\Functional\Module\DependencyTest::testIncompatibleModuleVersionDependency()

Tests enabling a module with an incompatible dependency version.

File

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

Class

DependencyTest
Enable module without dependency enabled.

Namespace

Drupal\Tests\system\Functional\Module

Code

public function testIncompatibleModuleVersionDependency() : void {
    // Test that the system_incompatible_module_version_dependencies_test is
    // marked as having an incompatible dependency.
    $this->drupalGet('admin/modules');
    $this->assertSession()
        ->pageTextContains('System incompatible module version test (>2.0) (incompatible with version 1.0)');
    $this->assertSession()
        ->elementTextEquals('xpath', '//tr[@data-drupal-selector="edit-modules-system-incompatible-module-version-dependencies-test"]//span[@class="admin-missing"]', 'incompatible with');
    $this->assertSession()
        ->fieldDisabled('modules[system_incompatible_module_version_dependencies_test][enable]');
}

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