
| Current Path : /var/www/html/stolberg/web/core/tests/Drupal/KernelTests/Core/Theme/ |
Linux ift1.ift-informatik.de 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64 |
| Current File : /var/www/html/stolberg/web/core/tests/Drupal/KernelTests/Core/Theme/MaintenanceThemeTest.php |
<?php
declare(strict_types=1);
namespace Drupal\KernelTests\Core\Theme;
use Drupal\KernelTests\KernelTestBase;
/**
* Tests themes and base themes are correctly loaded.
*
* @group Installer
*/
class MaintenanceThemeTest extends KernelTestBase {
/**
* Tests that the maintenance theme initializes the theme and its base themes.
*/
public function testMaintenanceTheme(): void {
$this->setSetting('maintenance_theme', 'test_subtheme');
// Get the maintenance theme loaded.
drupal_maintenance_theme();
// Do we have an active theme?
$this->assertTrue(\Drupal::theme()->hasActiveTheme());
$active_theme = \Drupal::theme()->getActiveTheme();
$this->assertEquals('test_subtheme', $active_theme->getName());
$base_themes = $active_theme->getBaseThemeExtensions();
$base_theme_names = array_keys($base_themes);
$this->assertSame(['test_basetheme'], $base_theme_names);
}
}