function ModuleHandlerTest::testLoadAllIncludes

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

@covers ::loadAllIncludes

File

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

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 testLoadAllIncludes() : void {
    $this->assertTrue(TRUE);
    $module_handler = $this->getMockBuilder(ModuleHandler::class)
        ->setConstructorArgs([
        $this->root,
        [
            'module_handler_test' => [
                'type' => 'module',
                'pathname' => 'core/tests/Drupal/Tests/Core/Extension/modules/module_handler_test/module_handler_test.info.yml',
                'filename' => 'module_handler_test.module',
            ],
        ],
        $this->cacheBackend,
    ])
        ->onlyMethods([
        'loadInclude',
    ])
        ->getMock();
    // Ensure we reset implementations when settings a new modules list.
    $module_handler->expects($this->once())
        ->method('loadInclude');
    $module_handler->loadAllIncludes('hook');
}

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