function HookCollectorPassTest::testHookAttribute
Test Hook attribute with named arguments, and class with invoke method.
File
-
core/
tests/ Drupal/ KernelTests/ Core/ Hook/ HookCollectorPassTest.php, line 130
Class
- HookCollectorPassTest
- @coversDefaultClass \Drupal\Core\Hook\HookCollectorPass @group Hook
Namespace
Drupal\KernelTests\Core\HookCode
public function testHookAttribute() : void {
$module_installer = $this->container
->get('module_installer');
$this->assertTrue($module_installer->install([
'hook_collector_hook_attribute',
]));
$this->assertFalse(isset($GLOBALS['hook_named_arguments']));
$this->assertFalse(isset($GLOBALS['hook_invoke_method']));
drupal_flush_all_caches();
$this->assertTrue(isset($GLOBALS['hook_named_arguments']));
$this->assertTrue(isset($GLOBALS['hook_invoke_method']));
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.