assertHookInvoked(); } public function test_static_class_function_as_string(): void { insert_hook('test_hook', 'Zotlabs\Tests\Unit\CallHooksTest::static_test_hook'); $this->assertHookInvoked(); } public function test_static_class_function_as_array(): void { insert_hook('test_hook', ['Zotlabs\Tests\Unit\CallHooksTest', 'static_test_hook']); $this->assertHookInvoked(); } public function test_static_class_function_as_serialized_array(): void { insert_hook('test_hook', serialize(['Zotlabs\Tests\Unit\CallHooksTest', 'static_test_hook'])); $this->assertHookInvoked(); } public function test_instance_function_as_array(): void { insert_hook('test_hook', [$this, 'instance_test_hook']); $this->assertHookInvoked(); } public function assertHookInvoked(): void { $test_hook_args = ['called' => false]; call_hooks('test_hook', $test_hook_args); $this->assertTrue($test_hook_args['called']); } public function instance_test_hook(array &$args): void { $args['called'] = true; } public static function static_test_hook(array &$args): void { $args['called'] = true; } }