1--TEST--
2Function snmp_set_oid_output_format
3--CREDITS--
4Olivier Doucet
5--EXTENSIONS--
6snmp
7--SKIPIF--
8<?php
9require_once(__DIR__.'/skipif.inc');
10if (!function_exists('snmp_set_oid_output_format')) die('skip This function is only available if using NET_SNMP');
11?>
12--FILE--
13<?php
14require_once(__DIR__.'/snmp_include.inc');
15
16echo "Checking error handling\n";
17try {
18    var_dump(snmp_set_oid_output_format(123));
19} catch (\ValueError $e) {
20    echo $e->getMessage() . \PHP_EOL;
21}
22
23echo "Checking working\n";
24var_dump(snmp_set_oid_output_format(SNMP_OID_OUTPUT_FULL));
25var_dump(snmp_set_oid_output_format(SNMP_OID_OUTPUT_NUMERIC));
26?>
27--EXPECT--
28Checking error handling
29snmp_set_oid_output_format(): Argument #1 ($format) must be an SNMP_OID_OUTPUT_* constant
30Checking working
31bool(true)
32bool(true)
33