summaryrefslogtreecommitdiff
path: root/ext/standard/tests/network/long2ip_error.phpt
diff options
context:
space:
mode:
authorDave Kelsey <dkelsey@php.net>2009-01-23 15:34:26 +0000
committerDave Kelsey <dkelsey@php.net>2009-01-23 15:34:26 +0000
commit8a81441f6a2858859f065ab7252e6e017e797e04 (patch)
tree1bf1dc74b6711093bc3d346ff01cb918d68deed1 /ext/standard/tests/network/long2ip_error.phpt
parent888bb4e7792db1ede3bc9f8dd75e15d3cf5933e2 (diff)
downloadphp-git-8a81441f6a2858859f065ab7252e6e017e797e04.tar.gz
various network tests. tested on windows, linux, linux 64 bit
Diffstat (limited to 'ext/standard/tests/network/long2ip_error.phpt')
-rw-r--r--ext/standard/tests/network/long2ip_error.phpt37
1 files changed, 37 insertions, 0 deletions
diff --git a/ext/standard/tests/network/long2ip_error.phpt b/ext/standard/tests/network/long2ip_error.phpt
new file mode 100644
index 0000000000..d56397cdd5
--- /dev/null
+++ b/ext/standard/tests/network/long2ip_error.phpt
@@ -0,0 +1,37 @@
+--TEST--
+Test long2ip() function : error conditions
+--FILE--
+<?php
+/* Prototype : string long2ip(int proper_address)
+ * Description: Converts an (IPv4) Internet network address into a string in Internet standard dotted format
+ * Source code: ext/standard/basic_functions.c
+ * Alias to functions:
+ */
+
+echo "*** Testing long2ip() : error conditions ***\n";
+
+// Zero arguments
+echo "\n-- Testing long2ip() function with Zero arguments --\n";
+var_dump( long2ip() );
+
+//Test long2ip with one more than the expected number of arguments
+echo "\n-- Testing long2ip() function with more than expected no. of arguments --\n";
+$proper_address = 10;
+$extra_arg = 10;
+var_dump( long2ip($proper_address, $extra_arg) );
+
+?>
+===DONE===
+--EXPECTF--
+*** Testing long2ip() : error conditions ***
+
+-- Testing long2ip() function with Zero arguments --
+
+Warning: long2ip() expects exactly 1 parameter, 0 given in %s on line %d
+NULL
+
+-- Testing long2ip() function with more than expected no. of arguments --
+
+Warning: long2ip() expects exactly 1 parameter, 2 given in %s on line %d
+NULL
+===DONE=== \ No newline at end of file