Commit c1ee4044 authored by catch's avatar catch
Browse files

Issue #3278124 by catch, nod_, andregp, quietone, deviantintegral, alexpott:...

Issue #3278124 by catch, nod_, andregp, quietone, deviantintegral, alexpott: Convert various tests that use bartik/seven to olivero/claro

(cherry picked from commit e44f94f3)
parent 57d03b6b
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -6,7 +6,7 @@
use Drupal\Tests\block\Traits\BlockCreationTrait;

/**
 * Tests that the new default theme gets blocks.
 * Tests that a new default theme gets blocks.
 *
 * @group block
 */
@@ -23,7 +23,7 @@ class NewDefaultThemeBlocksTest extends KernelTestBase {
  ];

  /**
   * Check the enabled Bartik blocks are correctly copied over.
   * Check the blocks are correctly copied by block_themes_installed().
   */
  public function testNewDefaultThemeBlocks() {
    $this->installConfig(['system']);
@@ -44,8 +44,8 @@ public function testNewDefaultThemeBlocks() {
      'id' => $default_theme . '_' . strtolower($this->randomMachineName(8)),
    ]);

    // Install a different theme.
    $new_theme = 'bartik';
    // Install a different theme that does not have blocks.
    $new_theme = 'test_theme';
    // The new theme is different from the previous default theme.
    $this->assertNotEquals($new_theme, $default_theme);

@@ -69,7 +69,7 @@ public function testNewDefaultThemeBlocks() {
    foreach ($default_block_names as $default_block_name) {
      // Remove the matching block from the list of blocks in the new theme.
      // E.g., if the old theme has block.block.stark_admin,
      // unset block.block.bartik_admin.
      // unset block.block.olivero_admin.
      unset($new_blocks[str_replace($default_theme . '_', $new_theme . '_', $default_block_name)]);
    }
    $this->assertEmpty($new_blocks);
+3 −3
Original line number Diff line number Diff line
@@ -187,7 +187,7 @@ public function testImageAltFunctionality() {
    // Test using alt directly with alt attribute.
    $image_with_alt_property = [
      '#theme' => 'image',
      '#uri' => '/core/themes/bartik/logo.svg',
      '#uri' => '/core/themes/olivero/logo.svg',
      '#alt' => 'Regular alt',
      '#title' => 'Test title',
      '#width' => '50%',
@@ -202,7 +202,7 @@ public function testImageAltFunctionality() {
    // Test using alt attribute inside attributes.
    $image_with_alt_attribute_alt_attribute = [
      '#theme' => 'image',
      '#uri' => '/core/themes/bartik/logo.svg',
      '#uri' => '/core/themes/olivero/logo.svg',
      '#width' => '50%',
      '#height' => '50%',
      '#attributes' => [
@@ -220,7 +220,7 @@ public function testImageAltFunctionality() {
    // Test using alt attribute as property and inside attributes.
    $image_with_alt_attribute_both = [
      '#theme' => 'image',
      '#uri' => '/core/themes/bartik/logo.svg',
      '#uri' => '/core/themes/olivero/logo.svg',
      '#width' => '50%',
      '#height' => '50%',
      '#alt' => 'Kitten sustainable',
+1 −1
Original line number Diff line number Diff line
@@ -52,7 +52,7 @@ function common_test_drupal_alter_alter(&$data, &$arg2 = NULL, &$arg3 = NULL) {
 * Same as common_test_drupal_alter_alter(), but here, we verify that themes
 * can also alter and come last.
 */
function bartik_drupal_alter_alter(&$data, &$arg2 = NULL, &$arg3 = NULL) {
function olivero_drupal_alter_alter(&$data, &$arg2 = NULL, &$arg3 = NULL) {
  // Alter first argument.
  if (is_array($data)) {
    $data['foo'] .= ' theme';
+4 −4
Original line number Diff line number Diff line
@@ -29,10 +29,10 @@ class PageTest extends BrowserTestBase {
  public function testBatchProgressPageTheme() {
    // Make sure that the page which starts the batch (an administrative page)
    // is using a different theme than would normally be used by the batch API.
    $this->container->get('theme_installer')->install(['seven', 'bartik']);
    $this->container->get('theme_installer')->install(['claro', 'olivero']);
    $this->config('system.theme')
      ->set('default', 'bartik')
      ->set('admin', 'seven')
      ->set('default', 'olivero')
      ->set('admin', 'claro')
      ->save();

    // Log in as an administrator who can see the administrative theme.
@@ -45,7 +45,7 @@ public function testBatchProgressPageTheme() {
    $this->drupalGet('admin/batch-test/test-theme');
    // The stack should contain the name of the theme used on the progress
    // page.
    $this->assertEquals(['seven'], batch_test_stack(), 'A progressive batch correctly uses the theme of the page that started the batch.');
    $this->assertEquals(['claro'], batch_test_stack(), 'A progressive batch correctly uses the theme of the page that started the batch.');
  }

  /**
+3 −3
Original line number Diff line number Diff line
@@ -27,10 +27,10 @@ class AlterTest extends BrowserTestBase {
   * Tests if the theme has been altered.
   */
  public function testDrupalAlter() {
    // This test depends on Bartik, so make sure that it is always the current
    // This test depends on Olivero, so make sure that it is always the current
    // active theme.
    \Drupal::service('theme_installer')->install(['bartik']);
    \Drupal::theme()->setActiveTheme(\Drupal::service('theme.initialization')->initTheme('bartik'));
    \Drupal::service('theme_installer')->install(['olivero']);
    \Drupal::theme()->setActiveTheme(\Drupal::service('theme.initialization')->initTheme('olivero'));

    $array = ['foo' => 'bar'];
    $entity = new \stdClass();
Loading