Upgraded drupal core with security updates
[yaffs-website] / web / core / tests / Drupal / KernelTests / Core / Theme / MaintenanceThemeTest.php
1 <?php
2
3 namespace Drupal\KernelTests\Core\Theme;
4
5 use Drupal\KernelTests\KernelTestBase;
6
7 /**
8  * Tests themes and base themes are correctly loaded.
9  *
10  * @group Installer
11  */
12 class MaintenanceThemeTest extends KernelTestBase {
13
14   /**
15    * Tests that the maintenance theme initializes the theme and its base themes.
16    */
17   public function testMaintenanceTheme() {
18     $this->setSetting('maintenance_theme', 'seven');
19     // Get the maintenance theme loaded.
20     drupal_maintenance_theme();
21
22     // Do we have an active theme?
23     $this->assertTrue(\Drupal::theme()->hasActiveTheme());
24
25     $active_theme = \Drupal::theme()->getActiveTheme();
26     $this->assertEquals('seven', $active_theme->getName());
27
28     $base_themes = $active_theme->getBaseThemes();
29     $base_theme_names = array_keys($base_themes);
30     $this->assertSame(['classy', 'stable'], $base_theme_names);
31
32     // Ensure Classy has the correct base themes and amount of base themes.
33     $classy_base_themes = $base_themes['classy']->getBaseThemes();
34     $classy_base_theme_names = array_keys($classy_base_themes);
35     $this->assertSame(['stable'], $classy_base_theme_names);
36   }
37
38 }