/**
* Tests loading a module.
*
* @covers ::load
*/
public function testLoadModule() { $module_handler =
$this->
getModuleHandler();
$this->
assertFalse(function_exists('module_handler_test_hook'
));
$this->
assertTrue($module_handler->
load('module_handler_test'
));
$this->
assertTrue(function_exists('module_handler_test_hook'
));
$module_handler->
addModule('module_handler_test_added', 'core/tests/Drupal/Tests/Core/Extension/modules/module_handler_test_added'
);
$this->
assertFalse(function_exists('module_handler_test_added_hook'
), 'Function does not exist before being loaded.'
);
$this->
assertTrue($module_handler->
load('module_handler_test_added'
));
$this->
assertTrue(function_exists('module_handler_test_added_helper'
), 'Function exists after being loaded.'
);
$this->
assertTrue($module_handler->
load('module_handler_test_added'
));
$this->
assertFalse($module_handler->
load('module_handler_test_dne'
), 'Non-existent modules returns false.'
);
} /**
* Tests loading all modules.
*
* @covers ::loadAll
*/