You are here

public function ModulesListFormWebTest::testRequiredByThemeMessage in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/system/tests/src/Functional/Form/ModulesListFormWebTest.php \Drupal\Tests\system\Functional\Form\ModulesListFormWebTest::testRequiredByThemeMessage()
  2. 9 core/modules/system/tests/src/Functional/Form/ModulesListFormWebTest.php \Drupal\Tests\system\Functional\Form\ModulesListFormWebTest::testRequiredByThemeMessage()

Confirm that module 'Required By' descriptions include dependent themes.

File

core/modules/system/tests/src/Functional/Form/ModulesListFormWebTest.php, line 127

Class

ModulesListFormWebTest
Tests \Drupal\system\Form\ModulesListForm.

Namespace

Drupal\Tests\system\Functional\Form

Code

public function testRequiredByThemeMessage() {
  $this
    ->drupalGet('admin/modules');
  $module_theme_depends_on_description = $this
    ->getSession()
    ->getPage()
    ->findAll('css', '#edit-modules-test-module-required-by-theme-enable-description .admin-requirements li:contains("Test Theme Depending on Modules (theme) (disabled)")');

  // Confirm that 'Test Theme Depending on Modules' is listed as being
  // required by the module 'Test Module Required by Theme'.
  $this
    ->assertCount(1, $module_theme_depends_on_description);

  // Confirm that the required by message does not appear anywhere else.
  $this
    ->assertSession()
    ->pageTextContains('Test Theme Depending on Modules (Theme) (Disabled)');
}