public function ModuleHandlerTest::testAddModule in Zircon Profile 8
Same name and namespace in other branches
- 8.0 core/tests/Drupal/Tests/Core/Extension/ModuleHandlerTest.php \Drupal\Tests\Core\Extension\ModuleHandlerTest::testAddModule()
Test adding a module.
@covers ::addModule @covers ::add
File
- core/
tests/ Drupal/ Tests/ Core/ Extension/ ModuleHandlerTest.php, line 193 - Contains \Drupal\Tests\Core\Extension\ModuleHandlerTest.
Class
- ModuleHandlerTest
- @coversDefaultClass \Drupal\Core\Extension\ModuleHandler @group Extension
Namespace
Drupal\Tests\Core\ExtensionCode
public function testAddModule() {
$module_handler = $this
->getMockBuilder('Drupal\\Core\\Extension\\ModuleHandler')
->setConstructorArgs(array(
$this->root,
array(),
$this->cacheBackend,
))
->setMethods(array(
'resetImplementations',
))
->getMock();
// Ensure we reset implementations when settings a new modules list.
$module_handler
->expects($this
->once())
->method('resetImplementations');
$module_handler
->addModule('module_handler_test', 'core/tests/Drupal/Tests/Core/Extension/modules/module_handler_test');
$this
->assertTrue($module_handler
->moduleExists('module_handler_test'));
}