You are here

function ThemeInstallerTest::testInstallNameTooLong in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/system/src/Tests/Extension/ThemeInstallerTest.php \Drupal\system\Tests\Extension\ThemeInstallerTest::testInstallNameTooLong()

Tests installing a theme with a too long name.

File

core/modules/system/src/Tests/Extension/ThemeInstallerTest.php, line 130
Contains \Drupal\system\Tests\Extension\ThemeInstallerTest.

Class

ThemeInstallerTest
Tests installing and uninstalling of themes.

Namespace

Drupal\system\Tests\Extension

Code

function testInstallNameTooLong() {
  $name = 'test_theme_having_veery_long_name_which_is_too_long';
  try {
    $message = 'ThemeHandler::install() throws ExtensionNameLengthException upon installing a theme with a too long name.';
    $this
      ->themeInstaller()
      ->install(array(
      $name,
    ));
    $this
      ->fail($message);
  } catch (ExtensionNameLengthException $e) {
    $this
      ->pass(get_class($e) . ': ' . $e
      ->getMessage());
  }
}