xref: /PHP-7.3/ext/snmp/tests/snmp_read_mib.phpt (revision 782352c5)
1--TEST--
2Function snmp_read_mib
3--CREDITS--
4Olivier Doucet Olivier Doucet Boris Lytochkin
5--SKIPIF--
6<?php
7require_once(dirname(__FILE__).'/skipif.inc');
8require_once(dirname(__FILE__).'/snmp_include.inc');
9
10if (!file_exists($mibdir . '/SNMPv2-MIB.txt')) die('skip MIB file not in the system');
11
12?>
13--FILE--
14<?php
15require_once(dirname(__FILE__).'/snmp_include.inc');
16
17echo "Checking error handling\n";
18var_dump(snmp_read_mib());
19var_dump(snmp_read_mib(dirname(__FILE__).'/cannotfindthisfile'));
20
21echo "Checking working\n";
22var_dump(snmp_read_mib($mibdir . '/SNMPv2-MIB.txt'));
23
24?>
25--EXPECTF--
26Checking error handling
27
28Warning: snmp_read_mib() expects exactly 1 parameter, 0 given in %s on line %d
29bool(false)
30
31Warning: snmp_read_mib(): Error while reading MIB file '%s': No such file or directory in %s on line %d
32bool(false)
33Checking working
34bool(true)
35