function HookCollectorPassTest::assertRegisteredHooks

Asserts that given hook implementations are registered in the container.

Parameters

array<string, array<string, string>> $implementationsByHook: Expected implementations, as module names keyed by hook name and "$class::$method" identifier.

\Symfony\Component\DependencyInjection\ContainerBuilder $container: The container builder.

2 calls to HookCollectorPassTest::assertRegisteredHooks()
HookCollectorPassTest::testOrdering in core/tests/Drupal/KernelTests/Core/Hook/HookCollectorPassTest.php
Test that ordering works.
HookCollectorPassTest::testSymlink in core/tests/Drupal/KernelTests/Core/Hook/HookCollectorPassTest.php
Test that symlinks are properly followed.

File

core/tests/Drupal/KernelTests/Core/Hook/HookCollectorPassTest.php, line 332

Class

HookCollectorPassTest
Tests Drupal\Core\Hook\HookCollectorPass.

Namespace

Drupal\KernelTests\Core\Hook

Code

protected function assertRegisteredHooks(array $implementationsByHook, ContainerBuilder $container) : void {
  foreach ($implementationsByHook as $hook => $implementations) {
    $this->assertEquals($implementations, $container->get('keyvalue')
      ->get('hook_data')
      ->get('hook_list')[$hook]);
  }
}

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