function ModuleHandlerTest::testInvokeAll

Same name and namespace in other branches
  1. 9 core/tests/Drupal/Tests/Core/Extension/ModuleHandlerTest.php \Drupal\Tests\Core\Extension\ModuleHandlerTest::testInvokeAll()
  2. 8.9.x core/tests/Drupal/Tests/Core/Extension/ModuleHandlerTest.php \Drupal\Tests\Core\Extension\ModuleHandlerTest::testInvokeAll()
  3. 10 core/tests/Drupal/Tests/Core/Extension/ModuleHandlerTest.php \Drupal\Tests\Core\Extension\ModuleHandlerTest::testInvokeAll()

Tests invoke all.

@covers ::invokeAll

File

core/tests/Drupal/Tests/Core/Extension/ModuleHandlerTest.php, line 442

Class

ModuleHandlerTest
@coversDefaultClass <a href="/api/drupal/core%21lib%21Drupal%21Core%21Extension%21ModuleHandler.php/class/ModuleHandler/11.x" title="Class that manages modules in a Drupal installation." class="local">\Drupal\Core\Extension\ModuleHandler</a> @runTestsInSeparateProcesses

Namespace

Drupal\Tests\Core\Extension

Code

public function testInvokeAll() : void {
    $module_handler = $this->getModuleHandler();
    $module_handler->addModule('module_handler_test_all1', 'core/tests/Drupal/Tests/Core/Extension/modules/module_handler_test_all1');
    $module_handler->addModule('module_handler_test_all2', 'core/tests/Drupal/Tests/Core/Extension/modules/module_handler_test_all2');
    $this->assertEquals([
        TRUE,
        TRUE,
        TRUE,
    ], $module_handler->invokeAll('hook', [
        TRUE,
    ]));
}

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