function ThemeInstallerTest::testInstallNameTooLong

Same name in other branches
  1. 8.9.x core/tests/Drupal/KernelTests/Core/Theme/ThemeInstallerTest.php \Drupal\KernelTests\Core\Theme\ThemeInstallerTest::testInstallNameTooLong()
  2. 10 core/tests/Drupal/KernelTests/Core/Theme/ThemeInstallerTest.php \Drupal\KernelTests\Core\Theme\ThemeInstallerTest::testInstallNameTooLong()
  3. 11.x core/tests/Drupal/KernelTests/Core/Theme/ThemeInstallerTest.php \Drupal\KernelTests\Core\Theme\ThemeInstallerTest::testInstallNameTooLong()

Tests installing a theme with a too long name.

File

core/tests/Drupal/KernelTests/Core/Theme/ThemeInstallerTest.php, line 132

Class

ThemeInstallerTest
Tests installing and uninstalling of themes.

Namespace

Drupal\KernelTests\Core\Theme

Code

public function testInstallNameTooLong() {
    $name = 'test_theme_having_veery_long_name_which_is_too_long';
    try {
        $message = 'ThemeInstaller::install() throws ExtensionNameLengthException upon installing a theme with a too long name.';
        $this->themeInstaller()
            ->install([
            $name,
        ]);
        $this->fail($message);
    } catch (\Exception $e) {
        $this->assertInstanceOf(ExtensionNameLengthException::class, $e);
    }
}

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