summaryrefslogtreecommitdiff
path: root/ext/standard/tests/network
diff options
context:
space:
mode:
Diffstat (limited to 'ext/standard/tests/network')
-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 000000000..2232d3626
--- /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 000000000..711490c41
--- /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 000000000..5ce7c4251
--- /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