function ThemeTest::testInvalidTheme

Test that themes can't be enabled when the base theme or engine is missing.

File

drupal/core/modules/system/lib/Drupal/system/Tests/System/ThemeTest.php, line 247
Definition of Drupal\system\Tests\System\ThemeTest.

Class

ThemeTest
Tests the theme interface functionality.

Namespace

Drupal\system\Tests\System

Code

function testInvalidTheme() {
  module_enable(array(
    'theme_page_test',
  ));
  $this
    ->drupalGet('admin/appearance');
  $this
    ->assertText(t('This theme requires the base theme @base_theme to operate correctly.', array(
    '@base_theme' => 'not_real_test_basetheme',
  )), 'Invalid base theme check succeeded.');
  $this
    ->assertText(t('This theme requires the theme engine @theme_engine to operate correctly.', array(
    '@theme_engine' => 'not_real_engine',
  )), 'Invalid theme engine check succeeded.');
}