function DependencyTest::testIncompatibleModuleVersionDependency

Tests enabling a module that depends on an incompatible version of a module.

File

drupal/core/modules/system/lib/Drupal/system/Tests/Module/DependencyTest.php, line 75
Definition of Drupal\system\Tests\Module\DependencyTest.

Class

DependencyTest
Tests module dependency functionality.

Namespace

Drupal\system\Tests\Module

Code

function testIncompatibleModuleVersionDependency() {

  // Test that the system_incompatible_module_version_dependencies_test is
  // marked as having an incompatible dependency.
  $this
    ->drupalGet('admin/modules');
  $this
    ->assertRaw(t('@module (<span class="admin-missing">incompatible with</span> version @version)', array(
    '@module' => 'System incompatible module version test (>2.0)',
    '@version' => '1.0',
  )), 'A module that depends on an incompatible version of a module is marked as such.');
  $checkbox = $this
    ->xpath('//input[@type="checkbox" and @disabled="disabled" and @name="modules[Testing][system_incompatible_module_version_dependencies_test][enable]"]');
  $this
    ->assert(count($checkbox) == 1, 'Checkbox for the module is disabled.');
}