Skip to content

Commit 29d56a5

Browse files
committed
add test
1 parent d3d8859 commit 29d56a5

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
--TEST--
2+
SNMP::__construct checks
3+
--CREDITS--
4+
Boris Lytochkin
5+
--EXTENSIONS--
6+
snmp
7+
--SKIPIF--
8+
<?php
9+
require_once(__DIR__.'/skipif.inc');
10+
?>
11+
--FILE--
12+
<?php
13+
require_once(__DIR__.'/snmp_include.inc');
14+
15+
$longhostname = str_repeat($hostname4, 1_000_000);
16+
new SNMP(SNMP::VERSION_1, "$hostname4:-1", $community, $timeout, $retries);
17+
new SNMP(SNMP::VERSION_1, "$hostname4:65536", $community, $timeout, $retries);
18+
new SNMP(SNMP::VERSION_1, "$longhostname:$port", $community, $timeout, $retries);
19+
echo "OK";
20+
?>
21+
--EXPECTF--
22+
23+
Warning: SNMP::__construct(): Remote port must be between 0 and 65535 in %s on line %d
24+
25+
Warning: SNMP::__construct(): Remote port must be between 0 and 65535 in %s on line %d
26+
27+
Warning: SNMP::__construct(): hostname length must be lower than 128 in %s on line %d
28+
OK

0 commit comments

Comments
 (0)