xref: /PHP-8.0/ext/snmp/tests/snmp_read_mib.phpt (revision 752012a4)
1--TEST--
2Function snmp_read_mib
3--CREDITS--
4Olivier Doucet Olivier Doucet Boris Lytochkin
5--SKIPIF--
6<?php
7require_once(__DIR__.'/skipif.inc');
8require_once(__DIR__.'/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(__DIR__.'/snmp_include.inc');
16
17echo "Checking error handling\n";
18var_dump(snmp_read_mib(__DIR__.'/cannotfindthisfile'));
19
20echo "Checking working\n";
21var_dump(snmp_read_mib($mibdir . '/SNMPv2-MIB.txt'));
22
23?>
24--EXPECTF--
25Checking error handling
26
27Warning: snmp_read_mib(): Error while reading MIB file '%s': No such file or directory in %s on line %d
28bool(false)
29Checking working
30bool(true)
31