function DependencyTest::testCoreVersionContains8X

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

Tests the dependency checks when core version contains '8.x' within it.

File

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

Class

DependencyTest
Enable module without dependency enabled.

Namespace

Drupal\Tests\system\Functional\Module

Code

public function testCoreVersionContains8X() : void {
    // Enable the helper module that alters the version and dependencies.
    \Drupal::service('module_installer')->install([
        'dependency_version_test',
    ]);
    // Check that the above module installed OK.
    $this->drupalGet('admin/modules');
    $this->assertModules([
        'dependency_version_test',
    ], TRUE);
    // Check that test_module dependencies are met and the box is not greyed.
    $this->assertSession()
        ->fieldEnabled('modules[test_module][enable]');
}

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