]> granicus.if.org Git - php/commitdiff
New basic network function tests. Tested on Windows, Linux and Linux 64 bit
authorandy wharmby <wharmby@php.net>
Fri, 28 Aug 2009 22:46:43 +0000 (22:46 +0000)
committerandy wharmby <wharmby@php.net>
Fri, 28 Aug 2009 22:46:43 +0000 (22:46 +0000)
ext/standard/tests/network/gethostbyaddr_basic1.phpt [new file with mode: 0644]
ext/standard/tests/network/gethostbyname_basic003.phpt [new file with mode: 0644]
ext/standard/tests/network/gethostbynamel_basic1.phpt [new file with mode: 0644]

diff --git a/ext/standard/tests/network/gethostbyaddr_basic1.phpt b/ext/standard/tests/network/gethostbyaddr_basic1.phpt
new file mode 100644 (file)
index 0000000..2232d36
--- /dev/null
@@ -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 (file)
index 0000000..711490c
--- /dev/null
@@ -0,0 +1,18 @@
+--TEST--\r
+Test gethostbyname() function : basic functionality \r
+--FILE--\r
+<?php\r
+/* Prototype  : string gethostbyname  ( string $hostname  )\r
+ * Description: Get the IPv4 address corresponding to a given Internet host name \r
+ * Source code: ext/standard/dns.c\r
+*/\r
+\r
+echo "*** Testing gethostbyname() : basic functionality ***\n";\r
+\r
+echo gethostbyname("localhost")."\n";\r
+?>\r
+===DONE===\r
+--EXPECT--\r
+*** Testing gethostbyname() : basic functionality ***\r
+127.0.0.1\r
+===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 (file)
index 0000000..5ce7c42
--- /dev/null
@@ -0,0 +1,19 @@
+--TEST--\r
+Test gethostbynamel() function : basic functionality \r
+--FILE--\r
+<?php\r
+/* Prototype  : array gethostbynamel  ( string $hostname  )\r
+ * Description: Get a list of IPv4 addresses corresponding to a given Internet host name \r
+ * Source code: ext/standard/dns.c\r
+*/\r
+\r
+echo "*** Testing gethostbynamel() : basic functionality ***\n";\r
+var_dump(gethostbynamel("localhost"));\r
+?>\r
+===DONE===\r
+--EXPECTF--\r
+*** Testing gethostbynamel() : basic functionality ***\r
+array(%d) {\r
+  %a\r
+}\r
+===DONE===
\ No newline at end of file