Commit 32a98379 authored by catch's avatar catch
Browse files

Issue #3415060 by Spokje, smustgrave: Convert AlterTest into a Kernel test

(cherry picked from commit 4e14cc64)
parent 0f25cc2f
Loading
Loading
Loading
Loading
Loading
+9 −13
Original line number Diff line number Diff line
<?php

namespace Drupal\Tests\system\Functional\Common;
namespace Drupal\Tests\system\Kernel\Common;

use Drupal\Tests\BrowserTestBase;
use Drupal\KernelTests\KernelTestBase;

/**
 * Tests alteration of arguments passed to \Drupal::moduleHandler->alter().
 *
 * @group Common
 */
class AlterTest extends BrowserTestBase {

  /**
   * Modules to enable.
   *
   * @var array
   */
  protected static $modules = ['block', 'common_test'];
class AlterTest extends KernelTestBase {

  /**
   * {@inheritdoc}
   */
  protected $defaultTheme = 'stark';
  protected static $modules = [
    'block',
    'common_test',
    'system',
  ];

  /**
   * Tests if the theme has been altered.
   */
  public function testDrupalAlter() {
  public function testDrupalAlter(): void {
    // This test depends on Olivero, so make sure that it is always the current
    // active theme.
    \Drupal::service('theme_installer')->install(['olivero']);
@@ -52,7 +49,6 @@ public function testDrupalAlter() {

    // Verify alteration of multiple arguments.
    $array_copy = $array;
    $array_expected = ['foo' => 'Drupal theme'];
    $entity_copy = clone $entity;
    $entity_expected = clone $entity;
    $entity_expected->foo = 'Drupal theme';