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