$this->
assertSession()->
pageTextNotContains('The following module is experimental: Experimental Dependency Test'
);
// There should be no message about enabling dependencies.
$this->
assertSession()->
pageTextNotContains('You must enable'
);
// Enable the module and confirm that it worked.
$this->
submitForm([], 'Continue'
);
$this->
assertSession()->
pageTextContains('2 modules have been enabled: Experimental Dependency Test, Experimental Test'
);
// Try to enable an experimental module that can not be due to
// hook_requirements().
\Drupal::
state()->
set('experimental_module_requirements_test_requirements', TRUE
);
$edit =
[];
$edit["modules[experimental_module_requirements_test][enable]"
] = TRUE;
$this->
drupalGet('admin/modules'
);
$this->
submitForm($edit, 'Install'
);
// Verify that if the module can not be installed, we are not taken to the
// confirm form.
$this->
assertSession()->
addressEquals('admin/modules'
);
$this->
assertSession()->
pageTextContains('The Experimental Test Requirements module can not be installed.'
);
}