Add test for addHook function.