You are here

public function DependencyTest::testMissingModules in Drupal 8

Same name and namespace in other branches
  1. 9 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 62

Class

DependencyTest
Enable module without dependency enabled.

Namespace

Drupal\Tests\system\Functional\Module

Code

public function testMissingModules() {

  // Test that the system_dependencies_test module is marked
  // as missing a dependency.
  $this
    ->drupalGet('admin/modules');
  $this
    ->assertRaw(t('@module (<span class="admin-missing">missing</span>)', [
    '@module' => Unicode::ucfirst('_missing_dependency'),
  ]), 'A module with missing dependencies is marked as such.');
  $checkbox = $this
    ->xpath('//input[@type="checkbox" and @disabled="disabled" and @name="modules[system_dependencies_test][enable]"]');
  $this
    ->assertCount(1, $checkbox, 'Checkbox for the module is disabled.');
}