function HookOrderTest::testHookReorderProcedural
Test procedural hook ordering using, 'test_procedural_reorder'.
The order of 'test_procedural_reorder', without modification would be as follows.
- \Drupal\aaa_hook_order_test\Hook\AHooks::testProceduralReorder()
- bbb_hook_order_test_test_procedural_reorder()
- ccc_hook_order_test_test_procedural_reorder()
That order is modified using the Remove and Reorder as follows and the resulting order asserted in this test.
- The Reorder attribute is used to move
- bbb_hook_order_test_test_procedural_reorder() to the first position.
- The Remove attribute is used to remove
See also
\bbb_hook_order_test_test_procedural_reorder()
\ccc_hook_order_test_test_procedural_reorder()
\Drupal\aaa_hook_order_test\Hook\AHooks::testProceduralReorder()
File
-
core/
tests/ Drupal/ KernelTests/ Core/ Hook/ HookOrderTest.php, line 294
Class
- HookOrderTest
- Tests Hook Order.
Namespace
Drupal\KernelTests\Core\HookCode
public function testHookReorderProcedural() : void {
$this->assertSameCallList([
'bbb_hook_order_test_test_procedural_reorder',
AHooks::class . '::testProceduralReorder',
], \Drupal::moduleHandler()->invokeAll('test_procedural_reorder'));
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.