You are here

function ModuleHandlerTest::testModuleInvoke in Service Container 7.2

Same name and namespace in other branches
  1. 7 lib/Drupal/service_container/Tests/ModuleHandlerTest.php \Drupal\service_container\Tests\ModuleHandlerTest::testModuleInvoke()

Test that module_invoke() can load a hook defined in hook_hook_info().

File

lib/Drupal/service_container/Tests/ModuleHandlerTest.php, line 102
Contains \Drupal\service_container\Tests\ModuleHandlerTest.

Class

ModuleHandlerTest
Tests the module_handler implementation of the service_container.

Namespace

Drupal\service_container\Tests

Code

function testModuleInvoke() {
  $this
    ->moduleInstaller()
    ->install(array(
    'module_test',
  ), FALSE);
  $result = $this
    ->moduleHandler()
    ->invoke('module_test', 'test_hook');
  $this
    ->assertEqual('success!', $result['module_test']);
}