You are here

public function ModuleHandlerTest::testLoadInclude in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/tests/Drupal/Tests/Core/Extension/ModuleHandlerTest.php \Drupal\Tests\Core\Extension\ModuleHandlerTest::testLoadInclude()

@covers ::loadInclude

Note we load code, so isolate the test.

@runInSeparateProcess @preserveGlobalState disabled

File

core/tests/Drupal/Tests/Core/Extension/ModuleHandlerTest.php, line 274
Contains \Drupal\Tests\Core\Extension\ModuleHandlerTest.

Class

ModuleHandlerTest
@coversDefaultClass \Drupal\Core\Extension\ModuleHandler @group Extension

Namespace

Drupal\Tests\Core\Extension

Code

public function testLoadInclude() {

  // Include exists.
  $this
    ->assertEquals(__DIR__ . '/modules/module_handler_test/hook_include.inc', $this->moduleHandler
    ->loadInclude('module_handler_test', 'inc', 'hook_include'));
  $this
    ->assertTrue(function_exists('module_handler_test_hook_include'));

  // Include doesn't exist.
  $this
    ->assertFalse($this->moduleHandler
    ->loadInclude('module_handler_test', 'install'));
}