Example #1
0
 /**
  * Test implementations methods when module is enabled.
  *
  * @covers ::implementsHook
  * @covers ::loadAllIncludes
  */
 public function testImplementsHookModuleEnabled()
 {
     $this->assertTrue($this->moduleHandler->implementsHook('module_handler_test', 'hook'), 'Installed module implementation found.');
     $this->moduleHandler->addModule('module_handler_test_added', 'core/tests/Drupal/Tests/Core/Extension/modules/module_handler_test_added');
     $this->assertTrue($this->moduleHandler->implementsHook('module_handler_test_added', 'hook'), 'Runtime added module with implementation in include found.');
     $this->moduleHandler->addModule('system', 'core/modules/system');
     $this->assertFalse($this->moduleHandler->implementsHook('system', 'hook', array(TRUE)), 'Missing implementation not found.');
 }