You are here

public function ThemeUiTest::testInstallModuleWithIncompatibleDependencies in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/system/tests/src/Functional/Theme/ThemeUiTest.php \Drupal\Tests\system\Functional\Theme\ThemeUiTest::testInstallModuleWithIncompatibleDependencies()

Tests installing a theme with incompatible module dependencies.

File

core/modules/system/tests/src/Functional/Theme/ThemeUiTest.php, line 313

Class

ThemeUiTest
Tests the theme UI.

Namespace

Drupal\Tests\system\Functional\Theme

Code

public function testInstallModuleWithIncompatibleDependencies() {
  $this->container
    ->get('module_installer')
    ->install([
    'test_module_compatible_constraint',
    'test_module_incompatible_constraint',
  ]);
  $this
    ->drupalGet('admin/appearance');
  $theme_container = $this
    ->getSession()
    ->getPage()
    ->find('css', 'h3:contains("Test Theme Depending on Version Constrained Modules")')
    ->getParent();
  $this
    ->assertStringContainsString('Requires: Test Module Theme Depends on with Compatible ConstraintTest Module Theme Depends on with Incompatible Constraint (>=8.x-2.x) (incompatible with version 8.x-1.8)', $theme_container
    ->getText());
  $this
    ->assertStringContainsString('This theme requires the listed modules to operate correctly.', $theme_container
    ->getText());
}