summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorandy wharmby <wharmby@php.net>2009-08-28 22:46:43 +0000
committerandy wharmby <wharmby@php.net>2009-08-28 22:46:43 +0000
commit037f617a60d3bb9e0c3cee47de40ad9b49c9a525 (patch)
treea8bbf58e789c2e38e996499f456f9a7e2e1ee749
parent0e4ce3bccac84196ce15f488735b7b8187978744 (diff)
downloadphp-git-037f617a60d3bb9e0c3cee47de40ad9b49c9a525.tar.gz
New basic network function tests. Tested on Windows, Linux and Linux 64 bit
-rw-r--r--ext/standard/tests/network/gethostbyaddr_basic1.phpt18
-rw-r--r--ext/standard/tests/network/gethostbyname_basic003.phpt18
-rw-r--r--ext/standard/tests/network/gethostbynamel_basic1.phpt19
3 files changed, 55 insertions, 0 deletions
diff --git a/ext/standard/tests/network/gethostbyaddr_basic1.phpt b/ext/standard/tests/network/gethostbyaddr_basic1.phpt
new file mode 100644
index 0000000000..2232d36265
--- /dev/null
+++ b/ext/standard/tests/network/gethostbyaddr_basic1.phpt
@@ -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=== \ No newline at end of file
diff --git a/ext/standard/tests/network/gethostbyname_basic003.phpt b/ext/standard/tests/network/gethostbyname_basic003.phpt
new file mode 100644
index 0000000000..711490c413
--- /dev/null
+++ b/ext/standard/tests/network/gethostbyname_basic003.phpt
@@ -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=== \ No newline at end of file
diff --git a/ext/standard/tests/network/gethostbynamel_basic1.phpt b/ext/standard/tests/network/gethostbynamel_basic1.phpt
new file mode 100644
index 0000000000..5ce7c4251a
--- /dev/null
+++ b/ext/standard/tests/network/gethostbynamel_basic1.phpt
@@ -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=== \ No newline at end of file