summaryrefslogtreecommitdiff
path: root/ext/snmp/tests/bug60749.phpt
blob: c31981c5afe30c3c21bc06a02f7cca8693ffa2c8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
--TEST--
Bug #60749: SNMP module should not strip non-standard SNMP port from hostname
--CREDITS--
Boris Lytochkin
--SKIPIF--
<?php
require_once(dirname(__FILE__).'/skipif.inc');
?>
--FILE--
<?php
require_once(dirname(__FILE__).'/snmp_include.inc');

$hostname = "php.net";
$ip = gethostbyname($hostname);
if (ip2long($ip) === FALSE) {
	echo "Could not resolve $hostname properly!\n";
	exit(1);
}
$port = 1161;
$session = new SNMP(SNMP::VERSION_1, "$hostname:$port", $community, $timeout, $retries);
$info = $session->info;
if (strcmp($info["hostname"], "$ip:$port") !== 0) {
	echo "'" . $info["hostname"] . "' != '$ip:$port'\n";
}
var_dump($session->close());
?>
--EXPECT--
bool(true)