You are here

function DependencyTest::testMissingModules in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/system/src/Tests/Module/DependencyTest.php \Drupal\system\Tests\Module\DependencyTest::testMissingModules()

Attempts to enable a module with a missing dependency.

File

core/modules/system/src/Tests/Module/DependencyTest.php, line 60
Contains \Drupal\system\Tests\Module\DependencyTest.

Class

DependencyTest
Enable module without dependency enabled.

Namespace

Drupal\system\Tests\Module

Code

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>)', array(
    '@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[Testing][system_dependencies_test][enable]"]');
  $this
    ->assert(count($checkbox) == 1, 'Checkbox for the module is disabled.');
}