function DependencyTest::testMissingModules

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

Attempts to enable a module with a missing dependency.

File

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

Class

DependencyTest
Enable module without dependency enabled.

Namespace

Drupal\Tests\system\Functional\Module

Code

public function testMissingModules() : void {
    // Test that the system_dependencies_test module is marked
    // as missing a dependency.
    $this->drupalGet('admin/modules');
    $this->assertSession()
        ->pageTextContains(Unicode::ucfirst('_missing_dependency') . ' (missing)');
    $this->assertSession()
        ->elementTextEquals('xpath', '//tr[@data-drupal-selector="edit-modules-system-dependencies-test"]//span[@class="admin-missing"]', 'missing');
    $this->assertSession()
        ->checkboxNotChecked('modules[system_dependencies_test][enable]');
}

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