Annotation of embedaddon/php/ext/snmp/tests/snmp_get_valueretrieval.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: Function snmp_get_valueretrieval / snmp_set_valueretrieval
3: --CREDITS--
4: Olivier Doucet
5: --SKIPIF--
6: <?php
7: require_once(dirname(__FILE__).'/skipif.inc');
8: ?>
9: --FILE--
10: <?php
11: require_once(dirname(__FILE__).'/snmp_include.inc');
12:
13: echo "Checking error handling\n";
14: var_dump(snmp_get_valueretrieval('noarg'));
15: var_dump(snmp_set_valueretrieval());
16: var_dump(snmp_set_valueretrieval('noarg'));
17: var_dump(snmp_set_valueretrieval(67));
18:
19: echo "Checking working\n";
20: var_dump(snmp_get_valueretrieval());
21: snmp_set_valueretrieval(SNMP_VALUE_LIBRARY);
22: var_dump(snmp_get_valueretrieval() === SNMP_VALUE_LIBRARY);
23: snmp_set_valueretrieval(SNMP_VALUE_PLAIN);
24: var_dump(snmp_get_valueretrieval() === SNMP_VALUE_PLAIN);
25: snmp_set_valueretrieval(SNMP_VALUE_OBJECT);
26: var_dump(snmp_get_valueretrieval() === SNMP_VALUE_OBJECT);
27: snmp_set_valueretrieval(SNMP_VALUE_PLAIN|SNMP_VALUE_OBJECT);
28: var_dump(snmp_get_valueretrieval() === (SNMP_VALUE_PLAIN|SNMP_VALUE_OBJECT));
29: snmp_set_valueretrieval(SNMP_VALUE_LIBRARY|SNMP_VALUE_OBJECT);
30: var_dump(snmp_get_valueretrieval() === (SNMP_VALUE_LIBRARY|SNMP_VALUE_OBJECT));
31:
32: ?>
33: --EXPECTF--
34: Checking error handling
35:
36: Warning: snmp_get_valueretrieval() expects exactly 0 parameters, 1 given in %s on line %d
37: bool(false)
38:
39: Warning: snmp_set_valueretrieval() expects exactly 1 parameter, 0 given in %s on line %d
40: bool(false)
41:
42: Warning: snmp_set_valueretrieval() expects parameter 1 to be long, %s given in %s on line %d
43: bool(false)
44:
45: Warning: snmp_set_valueretrieval(): Unknown SNMP value retrieval method '67' in %s on line %d
46: bool(false)
47: Checking working
48: int(%d)
49: bool(true)
50: bool(true)
51: bool(true)
52: bool(true)
53: bool(true)
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>