HookLoaderTest.php

Namespace

Drupal\KernelTests\Core\Hook

File

core/tests/Drupal/KernelTests/Core/Hook/HookLoaderTest.php

View source
<?php

declare (strict_types=1);
namespace Drupal\KernelTests\Core\Hook;

use Drupal\hook_loader_test\Hook\CircularDependencyHooks;
use Drupal\KernelTests\KernelTestBase;
use PHPUnit\Framework\Attributes\Group;
use PHPUnit\Framework\Attributes\RunTestsInSeparateProcesses;

/**
 * Test hook loading.
 */
class HookLoaderTest extends KernelTestBase {
  
  /**
   * {@inheritdoc}
   */
  protected static $modules = [
    'hook_loader_test',
  ];
  use HookOrderTestTrait;
  
  /**
   * Test hook implementation order.
   */
  public function testHookOrder() : void {
    $this->assertSameCallList([
      CircularDependencyHooks::class . '::testHook',
    ], \Drupal::moduleHandler()->invokeAll('test_hook'));
  }

}

Classes

Title Deprecated Summary
HookLoaderTest Test hook loading.

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.