function ModulesListFormWebTest::testRequiredByThemeMessage

Same name in other branches
  1. 9 core/modules/system/tests/src/Functional/Form/ModulesListFormWebTest.php \Drupal\Tests\system\Functional\Form\ModulesListFormWebTest::testRequiredByThemeMessage()
  2. 10 core/modules/system/tests/src/Functional/Form/ModulesListFormWebTest.php \Drupal\Tests\system\Functional\Form\ModulesListFormWebTest::testRequiredByThemeMessage()
  3. 11.x 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 79

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)');
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.