New basic network function tests. Tested on Windows, Linux and Linux 64 bit

This commit is contained in:
andy wharmby 2009-08-28 22:46:43 +00:00
parent 157453148a
commit 83b40961b7
3 changed files with 55 additions and 0 deletions

View File

@ -0,0 +1,18 @@
--TEST--
Test gethostbyaddr() function : basic functionality
--FILE--
<?php
/* Prototype : string gethostbyaddr ( string $ip_address )
* Description: Get the Internet host name corresponding to a given IP address
* Source code: ext/standard/dns.c
*/
echo "*** Testing gethostbyaddr() : basic functionality ***\n";
echo gethostbyaddr("127.0.0.1")."\n";
?>
===DONE===
--EXPECTF--
*** Testing gethostbyaddr() : basic functionality ***
%rloopback|localhost(\.localdomain)?%r
===DONE===

View File

@ -0,0 +1,18 @@
--TEST--
Test gethostbyname() function : basic functionality
--FILE--
<?php
/* Prototype : string gethostbyname ( string $hostname )
* Description: Get the IPv4 address corresponding to a given Internet host name
* Source code: ext/standard/dns.c
*/
echo "*** Testing gethostbyname() : basic functionality ***\n";
echo gethostbyname("localhost")."\n";
?>
===DONE===
--EXPECT--
*** Testing gethostbyname() : basic functionality ***
127.0.0.1
===DONE===

View File

@ -0,0 +1,19 @@
--TEST--
Test gethostbynamel() function : basic functionality
--FILE--
<?php
/* Prototype : array gethostbynamel ( string $hostname )
* Description: Get a list of IPv4 addresses corresponding to a given Internet host name
* Source code: ext/standard/dns.c
*/
echo "*** Testing gethostbynamel() : basic functionality ***\n";
var_dump(gethostbynamel("localhost"));
?>
===DONE===
--EXPECTF--
*** Testing gethostbynamel() : basic functionality ***
array(%d) {
%a
}
===DONE===