xref: /PHP-7.2/ext/interbase/tests/bug46247.phpt (revision f1d7e3ca)
1--TEST--
2Bug #46247 (ibase_set_event_handler() is allowing to pass callback without event)
3--SKIPIF--
4<?php include("skipif.inc"); ?>
5--FILE--
6<?php
7
8require("interbase.inc");
9
10$db = ibase_connect($test_base);
11
12function test() { }
13
14ibase_set_event_handler();
15
16ibase_set_event_handler('test', 1);
17ibase_set_event_handler($db, 'test', 1);
18ibase_set_event_handler(NULL, 'test', 1);
19
20
21ibase_set_event_handler('foo', 1);
22ibase_set_event_handler($db, 'foo', 1);
23ibase_set_event_handler(NULL, 'foo', 1);
24
25?>
26--EXPECTF--
27Warning: Wrong parameter count for ibase_set_event_handler() in %s on line %d
28
29Warning: ibase_set_event_handler(): supplied argument is not a valid InterBase link resource in %s on line %d
30
31Warning: ibase_set_event_handler(): Callback argument foo is not a callable function in %s on line %d
32
33Warning: ibase_set_event_handler(): Callback argument foo is not a callable function in %s on line %d
34
35Warning: ibase_set_event_handler(): supplied argument is not a valid InterBase link resource in %s on line %d
36