From a223aa1c613b28265a0aef65a7dbfb6752deecce Mon Sep 17 00:00:00 2001
From: catch <catch@35733.no-reply.drupal.org>
Date: Wed, 3 Aug 2022 16:31:08 +0900
Subject: [PATCH] Issue #3281444 by ravi.shankar, _shY, nod_, Vighneshh,
 deviantintegral, lauriii: Update Installer tests to not use Bartik and Seven

---
 .../Installer/DistributionProfileExistingSettingsTest.php     | 2 +-
 .../FunctionalTests/Installer/DistributionProfileTest.php     | 2 +-
 .../Installer/DistributionProfileTranslationQueryTest.php     | 2 +-
 .../Installer/DistributionProfileTranslationTest.php          | 2 +-
 core/tests/Drupal/FunctionalTests/Installer/InstallerTest.php | 2 +-
 .../Installer/MultipleDistributionsProfileTest.php            | 4 ++--
 .../FunctionalTests/Installer/StandardInstallerTest.php       | 2 +-
 core/themes/olivero/olivero.theme                             | 4 ++--
 8 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/core/tests/Drupal/FunctionalTests/Installer/DistributionProfileExistingSettingsTest.php b/core/tests/Drupal/FunctionalTests/Installer/DistributionProfileExistingSettingsTest.php
index 7e19154118ce..e8f77bd945c9 100644
--- a/core/tests/Drupal/FunctionalTests/Installer/DistributionProfileExistingSettingsTest.php
+++ b/core/tests/Drupal/FunctionalTests/Installer/DistributionProfileExistingSettingsTest.php
@@ -38,7 +38,7 @@ protected function prepareEnvironment() {
       'distribution' => [
         'name' => 'My Distribution',
         'install' => [
-          'theme' => 'bartik',
+          'theme' => 'olivero',
         ],
       ],
     ];
diff --git a/core/tests/Drupal/FunctionalTests/Installer/DistributionProfileTest.php b/core/tests/Drupal/FunctionalTests/Installer/DistributionProfileTest.php
index d8efca525c1f..68a9cd1485c5 100644
--- a/core/tests/Drupal/FunctionalTests/Installer/DistributionProfileTest.php
+++ b/core/tests/Drupal/FunctionalTests/Installer/DistributionProfileTest.php
@@ -32,7 +32,7 @@ protected function prepareEnvironment() {
       'distribution' => [
         'name' => 'My Distribution',
         'install' => [
-          'theme' => 'bartik',
+          'theme' => 'claro',
           'finish_url' => '/root-user',
         ],
       ],
diff --git a/core/tests/Drupal/FunctionalTests/Installer/DistributionProfileTranslationQueryTest.php b/core/tests/Drupal/FunctionalTests/Installer/DistributionProfileTranslationQueryTest.php
index a83452e3399b..2f7e08a92092 100644
--- a/core/tests/Drupal/FunctionalTests/Installer/DistributionProfileTranslationQueryTest.php
+++ b/core/tests/Drupal/FunctionalTests/Installer/DistributionProfileTranslationQueryTest.php
@@ -43,7 +43,7 @@ protected function prepareEnvironment() {
         'name' => 'My Distribution',
         'langcode' => $this->langcode,
         'install' => [
-          'theme' => 'bartik',
+          'theme' => 'claro',
         ],
       ],
     ];
diff --git a/core/tests/Drupal/FunctionalTests/Installer/DistributionProfileTranslationTest.php b/core/tests/Drupal/FunctionalTests/Installer/DistributionProfileTranslationTest.php
index 90c8c4c62c51..abf93bd65e84 100644
--- a/core/tests/Drupal/FunctionalTests/Installer/DistributionProfileTranslationTest.php
+++ b/core/tests/Drupal/FunctionalTests/Installer/DistributionProfileTranslationTest.php
@@ -45,7 +45,7 @@ protected function prepareEnvironment() {
         'name' => 'My Distribution',
         'langcode' => $this->langcode,
         'install' => [
-          'theme' => 'bartik',
+          'theme' => 'claro',
         ],
       ],
     ];
diff --git a/core/tests/Drupal/FunctionalTests/Installer/InstallerTest.php b/core/tests/Drupal/FunctionalTests/Installer/InstallerTest.php
index 4d1df63869e4..12a2f0ddcf16 100644
--- a/core/tests/Drupal/FunctionalTests/Installer/InstallerTest.php
+++ b/core/tests/Drupal/FunctionalTests/Installer/InstallerTest.php
@@ -53,7 +53,7 @@ public function testInstaller() {
   protected function setUpLanguage() {
     // Test that \Drupal\Core\Render\BareHtmlPageRenderer adds assets and
     // metatags as expected to the first page of the installer.
-    $this->assertSession()->responseContains("core/themes/claro/css/components/button.css");
+    $this->assertSession()->responseContains("css/components/button.css");
     $this->assertSession()->responseContains('<meta charset="utf-8" />');
 
     // Assert that the expected title is present.
diff --git a/core/tests/Drupal/FunctionalTests/Installer/MultipleDistributionsProfileTest.php b/core/tests/Drupal/FunctionalTests/Installer/MultipleDistributionsProfileTest.php
index ca71d7fb0427..b7754682db49 100644
--- a/core/tests/Drupal/FunctionalTests/Installer/MultipleDistributionsProfileTest.php
+++ b/core/tests/Drupal/FunctionalTests/Installer/MultipleDistributionsProfileTest.php
@@ -37,7 +37,7 @@ protected function prepareEnvironment() {
         'distribution' => [
           'name' => $name,
           'install' => [
-            'theme' => 'bartik',
+            'theme' => 'claro',
           ],
         ],
       ];
@@ -57,7 +57,7 @@ protected function setUpLanguage() {
     // Verify that the distribution name appears.
     $this->assertSession()->pageTextContains('distribution_one');
     // Verify that the requested theme is used.
-    $this->assertSession()->responseContains('bartik');
+    $this->assertSession()->responseContains('claro');
     // Verify that the "Choose profile" step does not appear.
     $this->assertSession()->pageTextNotContains('profile');
 
diff --git a/core/tests/Drupal/FunctionalTests/Installer/StandardInstallerTest.php b/core/tests/Drupal/FunctionalTests/Installer/StandardInstallerTest.php
index 7f9c0ae16a93..d49f373afebc 100644
--- a/core/tests/Drupal/FunctionalTests/Installer/StandardInstallerTest.php
+++ b/core/tests/Drupal/FunctionalTests/Installer/StandardInstallerTest.php
@@ -29,7 +29,7 @@ public function testInstaller() {
   protected function setUpSite() {
     // Test that the correct theme is being used.
     $this->assertSession()->responseNotContains('olivero');
-    $this->assertSession()->responseContains('themes/claro/css/theme/install-page.css');
+    $this->assertSession()->responseContains('css/theme/install-page.css');
     parent::setUpSite();
   }
 
diff --git a/core/themes/olivero/olivero.theme b/core/themes/olivero/olivero.theme
index f7a26615e646..37b29a915b2a 100644
--- a/core/themes/olivero/olivero.theme
+++ b/core/themes/olivero/olivero.theme
@@ -23,7 +23,7 @@ function olivero_preprocess_html(&$variables) {
   }
 
   // Convert custom hex to hsl so we can use the hue value
-  $brand_color_hex = theme_get_setting('base_primary_color');
+  $brand_color_hex = theme_get_setting('base_primary_color') ?? '#1b9ae4';
   [$h, $s, $l] = _olivero_hex_to_hsl($brand_color_hex);
 
   $variables['html_attributes']->setAttribute('style', "--color--primary-hue:$h;--color--primary-saturation:$s%;--color--primary-lightness:$l");
@@ -633,7 +633,7 @@ function olivero_form_views_exposed_form_alter(&$form) {
  *
  * @internal
  */
-function _olivero_hex_to_hsl($hex_string) {
+function _olivero_hex_to_hsl(string $hex_string) {
   // Convert hexcode pairs to rgb values (0-255).
   $hex_val = trim($hex_string, '#');
   $r0 = hexdec($hex_val[0] . $hex_val[1]);
-- 
GitLab