wharmby                                  Mon, 17 Aug 2009 10:37:30 +0000

Revision: http://svn.php.net/viewvc?view=revision&revision=287404

Log:
New basic string tests - includes back-porting a few existing tests back to 
5.2. All tested on Windows, Linux and Linux 64

Changed paths:
    A   
php/php-src/branches/PHP_5_2/ext/standard/tests/strings/soundex_basic.phpt
    A   
php/php-src/branches/PHP_5_2/ext/standard/tests/strings/soundex_error.phpt
    A   
php/php-src/branches/PHP_5_2/ext/standard/tests/strings/str_rot13_basic.phpt
    A   
php/php-src/branches/PHP_5_2/ext/standard/tests/strings/str_rot13_error.phpt
    A   
php/php-src/branches/PHP_5_2/ext/standard/tests/strings/strnatcasecmp_basic.phpt
    A   
php/php-src/branches/PHP_5_2/ext/standard/tests/strings/strnatcasecmp_error.phpt
    A   
php/php-src/branches/PHP_5_2/ext/standard/tests/strings/strnatcasecmp_variation1.phpt
    A   
php/php-src/branches/PHP_5_2/ext/standard/tests/strings/strnatcmp_basic.phpt
    A   
php/php-src/branches/PHP_5_2/ext/standard/tests/strings/strnatcmp_error.phpt
    A   
php/php-src/branches/PHP_5_2/ext/standard/tests/strings/strpbrk_basic.phpt
    A   
php/php-src/branches/PHP_5_2/ext/standard/tests/strings/strpbrk_error.phpt
    A   
php/php-src/branches/PHP_5_3/ext/standard/tests/strings/soundex_basic.phpt
    A   
php/php-src/branches/PHP_5_3/ext/standard/tests/strings/soundex_error.phpt
    A   
php/php-src/branches/PHP_5_3/ext/standard/tests/strings/str_rot13_basic.phpt
    A   
php/php-src/branches/PHP_5_3/ext/standard/tests/strings/str_rot13_error.phpt
    A   
php/php-src/branches/PHP_5_3/ext/standard/tests/strings/strnatcasecmp_error.phpt
    A   
php/php-src/branches/PHP_5_3/ext/standard/tests/strings/strnatcmp_basic.phpt
    A   
php/php-src/branches/PHP_5_3/ext/standard/tests/strings/strnatcmp_error.phpt
    A   php/php-src/trunk/ext/standard/tests/strings/soundex_basic.phpt
    A   php/php-src/trunk/ext/standard/tests/strings/soundex_error.phpt
    A   php/php-src/trunk/ext/standard/tests/strings/str_rot13_basic.phpt
    A   php/php-src/trunk/ext/standard/tests/strings/str_rot13_error.phpt
    A   php/php-src/trunk/ext/standard/tests/strings/strnatcasecmp_error.phpt
    A   php/php-src/trunk/ext/standard/tests/strings/strnatcmp_basic.phpt
    A   php/php-src/trunk/ext/standard/tests/strings/strnatcmp_error.phpt

Added: php/php-src/branches/PHP_5_2/ext/standard/tests/strings/soundex_basic.phpt
===================================================================
--- php/php-src/branches/PHP_5_2/ext/standard/tests/strings/soundex_basic.phpt	                        (rev 0)
+++ php/php-src/branches/PHP_5_2/ext/standard/tests/strings/soundex_basic.phpt	2009-08-17 10:37:30 UTC (rev 287404)
@@ -0,0 +1,46 @@
+--TEST--
+Test soundex() function : basic functionality
+--FILE--
+<?php
+/* Prototype  : string soundex  ( string $str  )
+ * Description: Calculate the soundex key of a string
+ * Source code: ext/standard/string.c
+*/
+echo "*** Testing soundex() : basic functionality ***\n";
+
+var_dump(soundex("Euler"));
+var_dump(soundex("Gauss"));
+var_dump(soundex("Hilbert"));
+var_dump(soundex("Knuth"));
+var_dump(soundex("Lloyd"));
+var_dump(soundex("Lukasiewicz"));
+
+var_dump(soundex("Euler")       == soundex("Ellery"));    // E460
+var_dump(soundex("Gauss")       == soundex("Ghosh"));     // G200
+var_dump(soundex("Hilbert")     == soundex("Heilbronn")); // H416
+var_dump(soundex("Knuth")       == soundex("Kant"));      // K530
+var_dump(soundex("Lloyd")       == soundex("Ladd"));      // L300
+var_dump(soundex("Lukasiewicz") == soundex("Lissajous")); // L222
+
+var_dump(soundex("Lukasiewicz") == soundex("Ghosh"));
+var_dump(soundex("Hilbert") == soundex("Ladd"));
+?>
+===DONE===
+--EXPECT--
+*** Testing soundex() : basic functionality ***
+string(4) "E460"
+string(4) "G200"
+string(4) "H416"
+string(4) "K530"
+string(4) "L300"
+string(4) "L222"
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(false)
+bool(false)
+
+===DONE===

Added: php/php-src/branches/PHP_5_2/ext/standard/tests/strings/soundex_error.phpt
===================================================================
--- php/php-src/branches/PHP_5_2/ext/standard/tests/strings/soundex_error.phpt	                        (rev 0)
+++ php/php-src/branches/PHP_5_2/ext/standard/tests/strings/soundex_error.phpt	2009-08-17 10:37:30 UTC (rev 287404)
@@ -0,0 +1,34 @@
+--TEST--
+Test soundex() function : error conditions
+--FILE--
+<?php
+/* Prototype  : string soundex  ( string $str  )
+ * Description: Calculate the soundex key of a string
+ * Source code: ext/standard/string.c
+*/
+
+echo "\n*** Testing soundex error conditions ***";
+
+echo "-- Testing soundex() function with Zero arguments --\n";
+var_dump( soundex() );
+
+echo "\n\n-- Testing soundex() function with more than expected no. of arguments --\n";
+$str = "Euler";
+$extra_arg = 10;
+var_dump( soundex( $str, $extra_arg) );
+
+?>
+===DONE===
+--EXPECTF--
+*** Testing soundex error conditions ***-- Testing soundex() function with Zero arguments --
+
+Warning: soundex() expects exactly 1 parameter, 0 given in %s on line %d
+NULL
+
+
+-- Testing soundex() function with more than expected no. of arguments --
+
+Warning: soundex() expects exactly 1 parameter, 2 given in %s on line %d
+NULL
+
+===DONE===
\ No newline at end of file

Added: php/php-src/branches/PHP_5_2/ext/standard/tests/strings/str_rot13_basic.phpt
===================================================================
--- php/php-src/branches/PHP_5_2/ext/standard/tests/strings/str_rot13_basic.phpt	                        (rev 0)
+++ php/php-src/branches/PHP_5_2/ext/standard/tests/strings/str_rot13_basic.phpt	2009-08-17 10:37:30 UTC (rev 287404)
@@ -0,0 +1,55 @@
+--TEST--
+Test soundex() function : basic functionality
+--FILE--
+<?php
+/* Prototype  : string str_rot13  ( string $str  )
+ * Description: Perform the rot13 transform on a string
+ * Source code: ext/standard/string.c
+*/
+echo "*** Testing str_rot13() : basic functionality ***\n";
+
+echo "\nBasic tests\n";
+var_dump(str_rot13("str_rot13() tests starting"));
+var_dump(str_rot13("abcdefghijklmnopqrstuvwxyz"));
+
+echo "\nEnsure numeric characters are left untouched\n";
+if (strcmp(str_rot13("0123456789"), "0123456789") == 0) {
+	echo "Strings equal : TEST PASSED\n";
+} else {
+	echo "Strings unequal : TEST FAILED\n";
+}
+
+echo "\nEnsure non-alphabetic characters are left untouched\n";
+if (strcmp(str_rot13("!%^&*()_-+={}[]:;@~#<,>.?"), "!%^&*()_-+={}[]:;@~#<,>.?")) {
+	echo "Strings equal : TEST PASSED\n";
+} else {
+	echo "Strings unequal : TEST FAILED\n";
+}
+
+echo "\nEnsure strings round trip\n";
+$str = "str_rot13() tests starting";
+$encode = str_rot13($str);
+$decode = str_rot13($encode);
+if (strcmp($str, $decode) == 0) {
+	echo "Strings equal : TEST PASSED\n";
+} else {
+	echo "Strings unequal : TEST FAILED\n";
+}
+?>
+===DONE===
+--EXPECTF--
+*** Testing str_rot13() : basic functionality ***
+
+Basic tests
+string(26) "fge_ebg13() grfgf fgnegvat"
+string(26) "nopqrstuvwxyzabcdefghijklm"
+
+Ensure numeric characters are left untouched
+Strings equal : TEST PASSED
+
+Ensure non-alphabetic characters are left untouched
+Strings unequal : TEST FAILED
+
+Ensure strings round trip
+Strings equal : TEST PASSED
+===DONE===
\ No newline at end of file

Added: php/php-src/branches/PHP_5_2/ext/standard/tests/strings/str_rot13_error.phpt
===================================================================
--- php/php-src/branches/PHP_5_2/ext/standard/tests/strings/str_rot13_error.phpt	                        (rev 0)
+++ php/php-src/branches/PHP_5_2/ext/standard/tests/strings/str_rot13_error.phpt	2009-08-17 10:37:30 UTC (rev 287404)
@@ -0,0 +1,32 @@
+--TEST--
+Test str_rot13() function : error conditions
+--FILE--
+<?php
+/* Prototype  : string str_rot13  ( string $str  )
+ * Description: Perform the rot13 transform on a string
+ * Source code: ext/standard/string.c
+*/
+echo "*** Testing str_rot13() : error conditions ***\n";
+
+echo "-- Testing str_rot13() function with Zero arguments --\n";
+var_dump( str_rot13() );
+
+echo "\n\n-- Testing str_rot13() function with more than expected no. of arguments --\n";
+$str = "str_rot13() tests starting";
+$extra_arg = 10;
+var_dump( str_rot13( $str, $extra_arg) );
+?>
+===DONE===
+--EXPECTF--
+*** Testing str_rot13() : error conditions ***
+-- Testing str_rot13() function with Zero arguments --
+
+Warning: Wrong parameter count for str_rot13() in %s on line %d
+NULL
+
+
+-- Testing str_rot13() function with more than expected no. of arguments --
+
+Warning: Wrong parameter count for str_rot13() in %s on line %d
+NULL
+===DONE===
\ No newline at end of file

Added: php/php-src/branches/PHP_5_2/ext/standard/tests/strings/strnatcasecmp_basic.phpt
===================================================================
--- php/php-src/branches/PHP_5_2/ext/standard/tests/strings/strnatcasecmp_basic.phpt	                        (rev 0)
+++ php/php-src/branches/PHP_5_2/ext/standard/tests/strings/strnatcasecmp_basic.phpt	2009-08-17 10:37:30 UTC (rev 287404)
@@ -0,0 +1,51 @@
+--TEST--
+Test strnatcasecmp() function : basic functionality
+--CREDITS--
+Felix De Vliegher <[email protected]>
+--FILE--
+<?php
+/* Prototype  : int strnatcasecmp(string s1, string s2)
+ * Description: Returns the result of case-insensitive string comparison using 'natural' algorithm
+ * Source code: ext/standard/string.c
+ * Alias to functions:
+ */
+
+function str_dump($one, $two) {
+	var_dump(strnatcasecmp($one, $two));
+}
+
+echo "*** Testing strnatcasecmp() : basic functionality ***\n";
+
+// Calling strnatcasecmp() with all possible arguments
+str_dump('A', 'a');
+str_dump('a10', 'A20');
+str_dump('A1b', 'a');
+str_dump('x2-y7', 'x8-y8');
+str_dump('1.010', '1.001');
+str_dump(' ab', ' aB');
+str_dump('acc ', 'acc');
+str_dump(11.5, 10.5);
+str_dump(10.5, 10.5E1);
+str_dump('Rfc822.txt', 'rfc2086.txt');
+str_dump('Rfc822.txt', 'rfc822.TXT');
+str_dump('pIc 6', 'pic   7');
+str_dump(0xFFF, 0Xfff);
+
+?>
+===DONE===
+--EXPECT--
+*** Testing strnatcasecmp() : basic functionality ***
+int(0)
+int(-1)
+int(1)
+int(-1)
+int(1)
+int(0)
+int(1)
+int(1)
+int(-1)
+int(-1)
+int(0)
+int(-1)
+int(0)
+===DONE===

Added: php/php-src/branches/PHP_5_2/ext/standard/tests/strings/strnatcasecmp_error.phpt
===================================================================
--- php/php-src/branches/PHP_5_2/ext/standard/tests/strings/strnatcasecmp_error.phpt	                        (rev 0)
+++ php/php-src/branches/PHP_5_2/ext/standard/tests/strings/strnatcasecmp_error.phpt	2009-08-17 10:37:30 UTC (rev 287404)
@@ -0,0 +1,33 @@
+--TEST--
+Test strnatcasecmp() function : error conditions
+--FILE--
+<?php
+/* Prototype  : int strnatcasecmp  ( string $str1  , string $str2  )
+ * Description: Case insensitive string comparisons using a "natural order" algorithm
+ * Source code: ext/standard/string.c
+*/
+echo "*** Testing strnatcasecmp() : error conditions ***\n";
+
+echo "-- Testing strnatcmp() function with Zero arguments --\n";
+var_dump( strnatcasecmp() );
+
+echo "\n\n-- Testing strnatcasecmp() function with more than expected no. of arguments --\n";
+$str1 = "abc1";
+$str2 = "ABC1";
+$extra_arg = 10;
+var_dump( strnatcasecmp( $str1, $str2, $extra_arg) );
+?>
+===DONE===
+--EXPECTF--
+*** Testing strnatcasecmp() : error conditions ***
+-- Testing strnatcmp() function with Zero arguments --
+
+Warning: Wrong parameter count for strnatcasecmp() in %s on line %d
+NULL
+
+
+-- Testing strnatcasecmp() function with more than expected no. of arguments --
+
+Warning: Wrong parameter count for strnatcasecmp() in %s on line %d
+NULL
+===DONE===
\ No newline at end of file

Added: php/php-src/branches/PHP_5_2/ext/standard/tests/strings/strnatcasecmp_variation1.phpt
===================================================================
--- php/php-src/branches/PHP_5_2/ext/standard/tests/strings/strnatcasecmp_variation1.phpt	                        (rev 0)
+++ php/php-src/branches/PHP_5_2/ext/standard/tests/strings/strnatcasecmp_variation1.phpt	2009-08-17 10:37:30 UTC (rev 287404)
@@ -0,0 +1,56 @@
+--TEST--
+Test strnatcasecmp() function : variation
+--CREDITS--
+Felix De Vliegher <[email protected]>
+--FILE--
+<?php
+/* Prototype  : int strnatcasecmp(string s1, string s2)
+ * Description: Returns the result of case-insensitive string comparison using 'natural' algorithm
+ * Source code: ext/standard/string.c
+ * Alias to functions:
+ */
+
+/* Preparation */
+class a
+{
+	function __toString()
+	{
+		return "Hello WORLD";
+	}
+}
+
+class b
+{
+	function __toString()
+	{
+		return "HELLO world";
+	}
+}
+
+$a = new a();
+$b = new b();
+
+function str_dump($a, $b) {
+	var_dump(strnatcasecmp($a, $b));
+}
+
+echo "*** Testing strnatcasecmp() : variation ***\n";
+
+str_dump('0', false);
+str_dump('fooBar', '');
+str_dump('', -1);
+str_dump("Hello\0world", "Helloworld");
+str_dump("\x0", "\0");
+str_dump($a, $b);
+
+?>
+===DONE===
+--EXPECT--
+*** Testing strnatcasecmp() : variation ***
+int(1)
+int(6)
+int(-2)
+int(-1)
+int(0)
+int(0)
+===DONE===

Added: php/php-src/branches/PHP_5_2/ext/standard/tests/strings/strnatcmp_basic.phpt
===================================================================
--- php/php-src/branches/PHP_5_2/ext/standard/tests/strings/strnatcmp_basic.phpt	                        (rev 0)
+++ php/php-src/branches/PHP_5_2/ext/standard/tests/strings/strnatcmp_basic.phpt	2009-08-17 10:37:30 UTC (rev 287404)
@@ -0,0 +1,80 @@
+--TEST--
+Test strnatcmp() function : basic functionality
+--FILE--
+<?php
+/* Prototype  : int strnatcmp  ( string $str1  , string $str2  )
+ * Description: String comparisons using a "natural order" algorithm
+ * Source code: ext/standard/string.c
+*/
+echo "*** Testing strnatcmp() : basic functionality ***\n";
+
+$a1 = "abc1";
+$b1 = "abc10";
+$c1 = "abc15";
+$d1 = "abc2";
+
+$a2 = "ABC1";
+$b2 = "ABC10";
+$c2 = "ABC15";
+$d2 = "ABC2";
+
+echo "Less than tests\n";
+var_dump(strnatcmp($a1, $b1));
+var_dump(strnatcmp($a1, $c1));
+var_dump(strnatcmp($a1, $d1));
+var_dump(strnatcmp($b1, $c1));
+var_dump(strnatcmp($d1, $c1));
+
+var_dump(strnatcmp($a1, $b2));
+var_dump(strnatcmp($a1, $c2));
+var_dump(strnatcmp($a1, $d2));
+var_dump(strnatcmp($b1, $c2));
+var_dump(strnatcmp($d1, $c2));
+
+
+echo "Equal too tests\n";
+var_dump(strnatcmp($b1, $b1));
+var_dump(strnatcmp($b1, $b2));
+
+echo "Greater than tests\n";
+var_dump(strnatcmp($b1, $a1));
+var_dump(strnatcmp($c1, $a1));
+var_dump(strnatcmp($d1, $a1));
+var_dump(strnatcmp($c1, $b1));
+var_dump(strnatcmp($c1, $d1));
+
+var_dump(strnatcmp($b1, $a2));
+var_dump(strnatcmp($c1, $a2));
+var_dump(strnatcmp($d1, $a2));
+var_dump(strnatcmp($c1, $b2));
+var_dump(strnatcmp($c1, $d2));
+?>
+===DONE===
+--EXPECT--
+*** Testing strnatcmp() : basic functionality ***
+Less than tests
+int(-1)
+int(-1)
+int(-1)
+int(-1)
+int(-1)
+int(1)
+int(1)
+int(1)
+int(1)
+int(1)
+Equal too tests
+int(0)
+int(1)
+Greater than tests
+int(1)
+int(1)
+int(1)
+int(1)
+int(1)
+int(1)
+int(1)
+int(1)
+int(1)
+int(1)
+===DONE===
\ No newline at end of file

Added: php/php-src/branches/PHP_5_2/ext/standard/tests/strings/strnatcmp_error.phpt
===================================================================
--- php/php-src/branches/PHP_5_2/ext/standard/tests/strings/strnatcmp_error.phpt	                        (rev 0)
+++ php/php-src/branches/PHP_5_2/ext/standard/tests/strings/strnatcmp_error.phpt	2009-08-17 10:37:30 UTC (rev 287404)
@@ -0,0 +1,34 @@
+--TEST--
+Test strnatcmp() function : error conditions
+--FILE--
+<?php
+/* Prototype  : int strnatcmp  ( string $str1  , string $str2  )
+ * Description: String comparisons using a "natural order" algorithm
+ * Source code: ext/standard/string.c
+*/
+echo "*** Testing strnatcmp() : error conditions ***\n";
+
+echo "-- Testing strnatcmp() function with Zero arguments --\n";
+var_dump( strnatcmp() );
+
+echo "\n\n-- Testing strnatcmp() function with more than expected no. of arguments --\n";
+$str1 = "abc1";
+$str2 = "ABC1";
+$extra_arg = 10;
+var_dump( strnatcmp( $str1, $str2, $extra_arg) );
+
+?>
+===DONE===
+--EXPECTF--
+*** Testing strnatcmp() : error conditions ***
+-- Testing strnatcmp() function with Zero arguments --
+
+Warning: Wrong parameter count for strnatcmp() in %s on line %d
+NULL
+
+
+-- Testing strnatcmp() function with more than expected no. of arguments --
+
+Warning: Wrong parameter count for strnatcmp() in %s on line %d
+NULL
+===DONE===
\ No newline at end of file

Added: php/php-src/branches/PHP_5_2/ext/standard/tests/strings/strpbrk_basic.phpt
===================================================================
--- php/php-src/branches/PHP_5_2/ext/standard/tests/strings/strpbrk_basic.phpt	                        (rev 0)
+++ php/php-src/branches/PHP_5_2/ext/standard/tests/strings/strpbrk_basic.phpt	2009-08-17 10:37:30 UTC (rev 287404)
@@ -0,0 +1,41 @@
+--TEST--
+Test strpbrk() function : basic functionality
+--FILE--
+<?php
+/* Prototype  : array strpbrk(string haystack, string char_list)
+ * Description: Search a string for any of a set of characters
+ * Source code: ext/standard/string.c
+ * Alias to functions:
+ */
+
+echo "*** Testing strpbrk() : basic functionality ***\n";
+
+// Initialise all required variables
+$text = 'This is a Simple text.';
+var_dump( strpbrk($text, 'mi') );
+var_dump( strpbrk($text, 'ZS') );
+var_dump( strpbrk($text, 'Z') );
+var_dump( strpbrk($text, 'H') );
+
+$text = '';
+var_dump( strpbrk($text, 'foo') );
+
+$text = "  aaa aaaSLR";
+var_dump( strpbrk($text, '     ') );
+
+var_dump( strpbrk(5, 5) );
+var_dump( strpbrk(5, "5") );
+
+?>
+===DONE===
+--EXPECT--
+*** Testing strpbrk() : basic functionality ***
+string(20) "is is a Simple text."
+string(12) "Simple text."
+bool(false)
+bool(false)
+bool(false)
+string(12) "  aaa aaaSLR"
+string(1) "5"
+string(1) "5"
+===DONE===

Added: php/php-src/branches/PHP_5_2/ext/standard/tests/strings/strpbrk_error.phpt
===================================================================
--- php/php-src/branches/PHP_5_2/ext/standard/tests/strings/strpbrk_error.phpt	                        (rev 0)
+++ php/php-src/branches/PHP_5_2/ext/standard/tests/strings/strpbrk_error.phpt	2009-08-17 10:37:30 UTC (rev 287404)
@@ -0,0 +1,57 @@
+--TEST--
+Test strpbrk() function : error conditions
+--FILE--
+<?php
+/* Prototype  : array strpbrk(string haystack, string char_list)
+ * Description: Search a string for any of a set of characters
+ * Source code: ext/standard/string.c
+ * Alias to functions:
+ */
+
+echo "*** Testing strpbrk() : error conditions ***\n";
+
+$haystack = 'This is a Simple text.';
+$char_list = 'string_val';
+$extra_arg = 10;
+
+echo "\n-- Testing strpbrk() function with more than expected no. of arguments --\n";
+var_dump( strpbrk($haystack, $char_list, $extra_arg) );
+
+echo "\n-- Testing strpbrk() function with less than expected no. of arguments --\n";
+var_dump( strpbrk($haystack) );
+
+echo "\n-- Testing strpbrk() function with empty second argument --\n";
+var_dump( strpbrk($haystack, '') );
+
+echo "\n-- Testing strpbrk() function with arrays --\n";
+var_dump( strpbrk($haystack, array('a', 'b', 'c') ) );
+var_dump( strpbrk(array('foo', 'bar'), 'b') );
+
+?>
+===DONE===
+--EXPECTF--
+*** Testing strpbrk() : error conditions ***
+
+-- Testing strpbrk() function with more than expected no. of arguments --
+
+Warning: strpbrk() expects exactly 2 parameters, 3 given in %s on line %d
+bool(false)
+
+-- Testing strpbrk() function with less than expected no. of arguments --
+
+Warning: strpbrk() expects exactly 2 parameters, 1 given in %s on line %d
+bool(false)
+
+-- Testing strpbrk() function with empty second argument --
+
+Warning: strpbrk(): The character list cannot be empty in %s on line %d
+bool(false)
+
+-- Testing strpbrk() function with arrays --
+
+Warning: strpbrk() expects parameter 2 to be string, array given in %s on line %d
+bool(false)
+
+Warning: strpbrk() expects parameter 1 to be string, array given in %s on line %d
+bool(false)
+===DONE===

Added: php/php-src/branches/PHP_5_3/ext/standard/tests/strings/soundex_basic.phpt
===================================================================
--- php/php-src/branches/PHP_5_3/ext/standard/tests/strings/soundex_basic.phpt	                        (rev 0)
+++ php/php-src/branches/PHP_5_3/ext/standard/tests/strings/soundex_basic.phpt	2009-08-17 10:37:30 UTC (rev 287404)
@@ -0,0 +1,46 @@
+--TEST--
+Test soundex() function : basic functionality
+--FILE--
+<?php
+/* Prototype  : string soundex  ( string $str  )
+ * Description: Calculate the soundex key of a string
+ * Source code: ext/standard/string.c
+*/
+echo "*** Testing soundex() : basic functionality ***\n";
+
+var_dump(soundex("Euler"));
+var_dump(soundex("Gauss"));
+var_dump(soundex("Hilbert"));
+var_dump(soundex("Knuth"));
+var_dump(soundex("Lloyd"));
+var_dump(soundex("Lukasiewicz"));
+
+var_dump(soundex("Euler")       == soundex("Ellery"));    // E460
+var_dump(soundex("Gauss")       == soundex("Ghosh"));     // G200
+var_dump(soundex("Hilbert")     == soundex("Heilbronn")); // H416
+var_dump(soundex("Knuth")       == soundex("Kant"));      // K530
+var_dump(soundex("Lloyd")       == soundex("Ladd"));      // L300
+var_dump(soundex("Lukasiewicz") == soundex("Lissajous")); // L222
+
+var_dump(soundex("Lukasiewicz") == soundex("Ghosh"));
+var_dump(soundex("Hilbert") == soundex("Ladd"));
+?>
+===DONE===
+--EXPECT--
+*** Testing soundex() : basic functionality ***
+string(4) "E460"
+string(4) "G200"
+string(4) "H416"
+string(4) "K530"
+string(4) "L300"
+string(4) "L222"
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(false)
+bool(false)
+
+===DONE===

Added: php/php-src/branches/PHP_5_3/ext/standard/tests/strings/soundex_error.phpt
===================================================================
--- php/php-src/branches/PHP_5_3/ext/standard/tests/strings/soundex_error.phpt	                        (rev 0)
+++ php/php-src/branches/PHP_5_3/ext/standard/tests/strings/soundex_error.phpt	2009-08-17 10:37:30 UTC (rev 287404)
@@ -0,0 +1,34 @@
+--TEST--
+Test soundex() function : error conditions
+--FILE--
+<?php
+/* Prototype  : string soundex  ( string $str  )
+ * Description: Calculate the soundex key of a string
+ * Source code: ext/standard/string.c
+*/
+
+echo "\n*** Testing soundex error conditions ***";
+
+echo "-- Testing soundex() function with Zero arguments --\n";
+var_dump( soundex() );
+
+echo "\n\n-- Testing soundex() function with more than expected no. of arguments --\n";
+$str = "Euler";
+$extra_arg = 10;
+var_dump( soundex( $str, $extra_arg) );
+
+?>
+===DONE===
+--EXPECTF--
+*** Testing soundex error conditions ***-- Testing soundex() function with Zero arguments --
+
+Warning: soundex() expects exactly 1 parameter, 0 given in %s on line %d
+NULL
+
+
+-- Testing soundex() function with more than expected no. of arguments --
+
+Warning: soundex() expects exactly 1 parameter, 2 given in %s on line %d
+NULL
+
+===DONE===
\ No newline at end of file

Added: php/php-src/branches/PHP_5_3/ext/standard/tests/strings/str_rot13_basic.phpt
===================================================================
--- php/php-src/branches/PHP_5_3/ext/standard/tests/strings/str_rot13_basic.phpt	                        (rev 0)
+++ php/php-src/branches/PHP_5_3/ext/standard/tests/strings/str_rot13_basic.phpt	2009-08-17 10:37:30 UTC (rev 287404)
@@ -0,0 +1,55 @@
+--TEST--
+Test soundex() function : basic functionality
+--FILE--
+<?php
+/* Prototype  : string str_rot13  ( string $str  )
+ * Description: Perform the rot13 transform on a string
+ * Source code: ext/standard/string.c
+*/
+echo "*** Testing str_rot13() : basic functionality ***\n";
+
+echo "\nBasic tests\n";
+var_dump(str_rot13("str_rot13() tests starting"));
+var_dump(str_rot13("abcdefghijklmnopqrstuvwxyz"));
+
+echo "\nEnsure numeric characters are left untouched\n";
+if (strcmp(str_rot13("0123456789"), "0123456789") == 0) {
+	echo "Strings equal : TEST PASSED\n";
+} else {
+	echo "Strings unequal : TEST FAILED\n";
+}
+
+echo "\nEnsure non-alphabetic characters are left untouched\n";
+if (strcmp(str_rot13("!%^&*()_-+={}[]:;@~#<,>.?"), "!%^&*()_-+={}[]:;@~#<,>.?")) {
+	echo "Strings equal : TEST PASSED\n";
+} else {
+	echo "Strings unequal : TEST FAILED\n";
+}
+
+echo "\nEnsure strings round trip\n";
+$str = "str_rot13() tests starting";
+$encode = str_rot13($str);
+$decode = str_rot13($encode);
+if (strcmp($str, $decode) == 0) {
+	echo "Strings equal : TEST PASSED\n";
+} else {
+	echo "Strings unequal : TEST FAILED\n";
+}
+?>
+===DONE===
+--EXPECTF--
+*** Testing str_rot13() : basic functionality ***
+
+Basic tests
+string(26) "fge_ebg13() grfgf fgnegvat"
+string(26) "nopqrstuvwxyzabcdefghijklm"
+
+Ensure numeric characters are left untouched
+Strings equal : TEST PASSED
+
+Ensure non-alphabetic characters are left untouched
+Strings unequal : TEST FAILED
+
+Ensure strings round trip
+Strings equal : TEST PASSED
+===DONE===
\ No newline at end of file

Added: php/php-src/branches/PHP_5_3/ext/standard/tests/strings/str_rot13_error.phpt
===================================================================
--- php/php-src/branches/PHP_5_3/ext/standard/tests/strings/str_rot13_error.phpt	                        (rev 0)
+++ php/php-src/branches/PHP_5_3/ext/standard/tests/strings/str_rot13_error.phpt	2009-08-17 10:37:30 UTC (rev 287404)
@@ -0,0 +1,32 @@
+--TEST--
+Test str_rot13() function : error conditions
+--FILE--
+<?php
+/* Prototype  : string str_rot13  ( string $str  )
+ * Description: Perform the rot13 transform on a string
+ * Source code: ext/standard/string.c
+*/
+echo "*** Testing str_rot13() : error conditions ***\n";
+
+echo "-- Testing str_rot13() function with Zero arguments --\n";
+var_dump( str_rot13() );
+
+echo "\n\n-- Testing str_rot13() function with more than expected no. of arguments --\n";
+$str = "str_rot13() tests starting";
+$extra_arg = 10;
+var_dump( str_rot13( $str, $extra_arg) );
+?>
+===DONE===
+--EXPECTF--
+*** Testing str_rot13() : error conditions ***
+-- Testing str_rot13() function with Zero arguments --
+
+Warning: str_rot13() expects exactly 1 parameter, 0 given in %s on line %d
+NULL
+
+
+-- Testing str_rot13() function with more than expected no. of arguments --
+
+Warning: str_rot13() expects exactly 1 parameter, 2 given in %s on line %d
+NULL
+===DONE===
\ No newline at end of file

Added: php/php-src/branches/PHP_5_3/ext/standard/tests/strings/strnatcasecmp_error.phpt
===================================================================
--- php/php-src/branches/PHP_5_3/ext/standard/tests/strings/strnatcasecmp_error.phpt	                        (rev 0)
+++ php/php-src/branches/PHP_5_3/ext/standard/tests/strings/strnatcasecmp_error.phpt	2009-08-17 10:37:30 UTC (rev 287404)
@@ -0,0 +1,33 @@
+--TEST--
+Test strnatcasecmp() function : error conditions
+--FILE--
+<?php
+/* Prototype  : int strnatcasecmp  ( string $str1  , string $str2  )
+ * Description: Case insensitive string comparisons using a "natural order" algorithm
+ * Source code: ext/standard/string.c
+*/
+echo "*** Testing strnatcasecmp() : error conditions ***\n";
+
+echo "-- Testing strnatcmp() function with Zero arguments --\n";
+var_dump( strnatcasecmp() );
+
+echo "\n\n-- Testing strnatcasecmp() function with more than expected no. of arguments --\n";
+$str1 = "abc1";
+$str2 = "ABC1";
+$extra_arg = 10;
+var_dump( strnatcasecmp( $str1, $str2, $extra_arg) );
+?>
+===DONE===
+--EXPECTF--
+*** Testing strnatcasecmp() : error conditions ***
+-- Testing strnatcmp() function with Zero arguments --
+
+Warning: strnatcasecmp() expects exactly 2 parameters, 0 given in %s on line %d
+NULL
+
+
+-- Testing strnatcasecmp() function with more than expected no. of arguments --
+
+Warning: strnatcasecmp() expects exactly 2 parameters, 3 given in %s on line %d
+NULL
+===DONE===
\ No newline at end of file

Added: php/php-src/branches/PHP_5_3/ext/standard/tests/strings/strnatcmp_basic.phpt
===================================================================
--- php/php-src/branches/PHP_5_3/ext/standard/tests/strings/strnatcmp_basic.phpt	                        (rev 0)
+++ php/php-src/branches/PHP_5_3/ext/standard/tests/strings/strnatcmp_basic.phpt	2009-08-17 10:37:30 UTC (rev 287404)
@@ -0,0 +1,80 @@
+--TEST--
+Test strnatcmp() function : basic functionality
+--FILE--
+<?php
+/* Prototype  : int strnatcmp  ( string $str1  , string $str2  )
+ * Description: String comparisons using a "natural order" algorithm
+ * Source code: ext/standard/string.c
+*/
+echo "*** Testing strnatcmp() : basic functionality ***\n";
+
+$a1 = "abc1";
+$b1 = "abc10";
+$c1 = "abc15";
+$d1 = "abc2";
+
+$a2 = "ABC1";
+$b2 = "ABC10";
+$c2 = "ABC15";
+$d2 = "ABC2";
+
+echo "Less than tests\n";
+var_dump(strnatcmp($a1, $b1));
+var_dump(strnatcmp($a1, $c1));
+var_dump(strnatcmp($a1, $d1));
+var_dump(strnatcmp($b1, $c1));
+var_dump(strnatcmp($d1, $c1));
+
+var_dump(strnatcmp($a1, $b2));
+var_dump(strnatcmp($a1, $c2));
+var_dump(strnatcmp($a1, $d2));
+var_dump(strnatcmp($b1, $c2));
+var_dump(strnatcmp($d1, $c2));
+
+
+echo "Equal too tests\n";
+var_dump(strnatcmp($b1, $b1));
+var_dump(strnatcmp($b1, $b2));
+
+echo "Greater than tests\n";
+var_dump(strnatcmp($b1, $a1));
+var_dump(strnatcmp($c1, $a1));
+var_dump(strnatcmp($d1, $a1));
+var_dump(strnatcmp($c1, $b1));
+var_dump(strnatcmp($c1, $d1));
+
+var_dump(strnatcmp($b1, $a2));
+var_dump(strnatcmp($c1, $a2));
+var_dump(strnatcmp($d1, $a2));
+var_dump(strnatcmp($c1, $b2));
+var_dump(strnatcmp($c1, $d2));
+?>
+===DONE===
+--EXPECT--
+*** Testing strnatcmp() : basic functionality ***
+Less than tests
+int(-1)
+int(-1)
+int(-1)
+int(-1)
+int(-1)
+int(1)
+int(1)
+int(1)
+int(1)
+int(1)
+Equal too tests
+int(0)
+int(1)
+Greater than tests
+int(1)
+int(1)
+int(1)
+int(1)
+int(1)
+int(1)
+int(1)
+int(1)
+int(1)
+int(1)
+===DONE===
\ No newline at end of file

Added: php/php-src/branches/PHP_5_3/ext/standard/tests/strings/strnatcmp_error.phpt
===================================================================
--- php/php-src/branches/PHP_5_3/ext/standard/tests/strings/strnatcmp_error.phpt	                        (rev 0)
+++ php/php-src/branches/PHP_5_3/ext/standard/tests/strings/strnatcmp_error.phpt	2009-08-17 10:37:30 UTC (rev 287404)
@@ -0,0 +1,34 @@
+--TEST--
+Test strnatcmp() function : error conditions
+--FILE--
+<?php
+/* Prototype  : int strnatcmp  ( string $str1  , string $str2  )
+ * Description: String comparisons using a "natural order" algorithm
+ * Source code: ext/standard/string.c
+*/
+echo "*** Testing strnatcmp() : error conditions ***\n";
+
+echo "-- Testing strnatcmp() function with Zero arguments --\n";
+var_dump( strnatcmp() );
+
+echo "\n\n-- Testing strnatcmp() function with more than expected no. of arguments --\n";
+$str1 = "abc1";
+$str2 = "ABC1";
+$extra_arg = 10;
+var_dump( strnatcmp( $str1, $str2, $extra_arg) );
+
+?>
+===DONE===
+--EXPECTF--
+*** Testing strnatcmp() : error conditions ***
+-- Testing strnatcmp() function with Zero arguments --
+
+Warning: strnatcmp() expects exactly 2 parameters, 0 given in %s on line %d
+NULL
+
+
+-- Testing strnatcmp() function with more than expected no. of arguments --
+
+Warning: strnatcmp() expects exactly 2 parameters, 3 given in %s on line %d
+NULL
+===DONE===

Added: php/php-src/trunk/ext/standard/tests/strings/soundex_basic.phpt
===================================================================
--- php/php-src/trunk/ext/standard/tests/strings/soundex_basic.phpt	                        (rev 0)
+++ php/php-src/trunk/ext/standard/tests/strings/soundex_basic.phpt	2009-08-17 10:37:30 UTC (rev 287404)
@@ -0,0 +1,46 @@
+--TEST--
+Test soundex() function : basic functionality
+--FILE--
+<?php
+/* Prototype  : string soundex  ( string $str  )
+ * Description: Calculate the soundex key of a string
+ * Source code: ext/standard/string.c
+*/
+echo "*** Testing soundex() : basic functionality ***\n";
+
+var_dump(soundex("Euler"));
+var_dump(soundex("Gauss"));
+var_dump(soundex("Hilbert"));
+var_dump(soundex("Knuth"));
+var_dump(soundex("Lloyd"));
+var_dump(soundex("Lukasiewicz"));
+
+var_dump(soundex("Euler")       == soundex("Ellery"));    // E460
+var_dump(soundex("Gauss")       == soundex("Ghosh"));     // G200
+var_dump(soundex("Hilbert")     == soundex("Heilbronn")); // H416
+var_dump(soundex("Knuth")       == soundex("Kant"));      // K530
+var_dump(soundex("Lloyd")       == soundex("Ladd"));      // L300
+var_dump(soundex("Lukasiewicz") == soundex("Lissajous")); // L222
+
+var_dump(soundex("Lukasiewicz") == soundex("Ghosh"));
+var_dump(soundex("Hilbert") == soundex("Ladd"));
+?>
+===DONE===
+--EXPECT--
+*** Testing soundex() : basic functionality ***
+string(4) "E460"
+string(4) "G200"
+string(4) "H416"
+string(4) "K530"
+string(4) "L300"
+string(4) "L222"
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(false)
+bool(false)
+
+===DONE===

Added: php/php-src/trunk/ext/standard/tests/strings/soundex_error.phpt
===================================================================
--- php/php-src/trunk/ext/standard/tests/strings/soundex_error.phpt	                        (rev 0)
+++ php/php-src/trunk/ext/standard/tests/strings/soundex_error.phpt	2009-08-17 10:37:30 UTC (rev 287404)
@@ -0,0 +1,34 @@
+--TEST--
+Test soundex() function : error conditions
+--FILE--
+<?php
+/* Prototype  : string soundex  ( string $str  )
+ * Description: Calculate the soundex key of a string
+ * Source code: ext/standard/string.c
+*/
+
+echo "\n*** Testing soundex error conditions ***";
+
+echo "-- Testing soundex() function with Zero arguments --\n";
+var_dump( soundex() );
+
+echo "\n\n-- Testing soundex() function with more than expected no. of arguments --\n";
+$str = "Euler";
+$extra_arg = 10;
+var_dump( soundex( $str, $extra_arg) );
+
+?>
+===DONE===
+--EXPECTF--
+*** Testing soundex error conditions ***-- Testing soundex() function with Zero arguments --
+
+Warning: soundex() expects exactly 1 parameter, 0 given in %s on line %d
+NULL
+
+
+-- Testing soundex() function with more than expected no. of arguments --
+
+Warning: soundex() expects exactly 1 parameter, 2 given in %s on line %d
+NULL
+
+===DONE===
\ No newline at end of file

Added: php/php-src/trunk/ext/standard/tests/strings/str_rot13_basic.phpt
===================================================================
--- php/php-src/trunk/ext/standard/tests/strings/str_rot13_basic.phpt	                        (rev 0)
+++ php/php-src/trunk/ext/standard/tests/strings/str_rot13_basic.phpt	2009-08-17 10:37:30 UTC (rev 287404)
@@ -0,0 +1,55 @@
+--TEST--
+Test soundex() function : basic functionality
+--FILE--
+<?php
+/* Prototype  : string str_rot13  ( string $str  )
+ * Description: Perform the rot13 transform on a string
+ * Source code: ext/standard/string.c
+*/
+echo "*** Testing str_rot13() : basic functionality ***\n";
+
+echo "\nBasic tests\n";
+var_dump(str_rot13("str_rot13() tests starting"));
+var_dump(str_rot13("abcdefghijklmnopqrstuvwxyz"));
+
+echo "\nEnsure numeric characters are left untouched\n";
+if (strcmp(str_rot13("0123456789"), "0123456789") == 0) {
+	echo "Strings equal : TEST PASSED\n";
+} else {
+	echo "Strings unequal : TEST FAILED\n";
+}
+
+echo "\nEnsure non-alphabetic characters are left untouched\n";
+if (strcmp(str_rot13("!%^&*()_-+={}[]:;@~#<,>.?"), "!%^&*()_-+={}[]:;@~#<,>.?")) {
+	echo "Strings equal : TEST PASSED\n";
+} else {
+	echo "Strings unequal : TEST FAILED\n";
+}
+
+echo "\nEnsure strings round trip\n";
+$str = "str_rot13() tests starting";
+$encode = str_rot13($str);
+$decode = str_rot13($encode);
+if (strcmp($str, $decode) == 0) {
+	echo "Strings equal : TEST PASSED\n";
+} else {
+	echo "Strings unequal : TEST FAILED\n";
+}
+?>
+===DONE===
+--EXPECTF--
+*** Testing str_rot13() : basic functionality ***
+
+Basic tests
+unicode(26) "fge_ebg13() grfgf fgnegvat"
+unicode(26) "nopqrstuvwxyzabcdefghijklm"
+
+Ensure numeric characters are left untouched
+Strings equal : TEST PASSED
+
+Ensure non-alphabetic characters are left untouched
+Strings unequal : TEST FAILED
+
+Ensure strings round trip
+Strings equal : TEST PASSED
+===DONE===
\ No newline at end of file

Added: php/php-src/trunk/ext/standard/tests/strings/str_rot13_error.phpt
===================================================================
--- php/php-src/trunk/ext/standard/tests/strings/str_rot13_error.phpt	                        (rev 0)
+++ php/php-src/trunk/ext/standard/tests/strings/str_rot13_error.phpt	2009-08-17 10:37:30 UTC (rev 287404)
@@ -0,0 +1,32 @@
+--TEST--
+Test str_rot13() function : error conditions
+--FILE--
+<?php
+/* Prototype  : string str_rot13  ( string $str  )
+ * Description: Perform the rot13 transform on a string
+ * Source code: ext/standard/string.c
+*/
+echo "*** Testing str_rot13() : error conditions ***\n";
+
+echo "-- Testing str_rot13() function with Zero arguments --\n";
+var_dump( str_rot13() );
+
+echo "\n\n-- Testing str_rot13() function with more than expected no. of arguments --\n";
+$str = "str_rot13() tests starting";
+$extra_arg = 10;
+var_dump( str_rot13( $str, $extra_arg) );
+?>
+===DONE===
+--EXPECTF--
+*** Testing str_rot13() : error conditions ***
+-- Testing str_rot13() function with Zero arguments --
+
+Warning: str_rot13() expects exactly 1 parameter, 0 given in %s on line %d
+NULL
+
+
+-- Testing str_rot13() function with more than expected no. of arguments --
+
+Warning: str_rot13() expects exactly 1 parameter, 2 given in %s on line %d
+NULL
+===DONE===
\ No newline at end of file

Added: php/php-src/trunk/ext/standard/tests/strings/strnatcasecmp_error.phpt
===================================================================
--- php/php-src/trunk/ext/standard/tests/strings/strnatcasecmp_error.phpt	                        (rev 0)
+++ php/php-src/trunk/ext/standard/tests/strings/strnatcasecmp_error.phpt	2009-08-17 10:37:30 UTC (rev 287404)
@@ -0,0 +1,33 @@
+--TEST--
+Test strnatcasecmp() function : error conditions
+--FILE--
+<?php
+/* Prototype  : int strnatcasecmp  ( string $str1  , string $str2  )
+ * Description: Case insensitive string comparisons using a "natural order" algorithm
+ * Source code: ext/standard/string.c
+*/
+echo "*** Testing strnatcasecmp() : error conditions ***\n";
+
+echo "-- Testing strnatcmp() function with Zero arguments --\n";
+var_dump( strnatcasecmp() );
+
+echo "\n\n-- Testing strnatcasecmp() function with more than expected no. of arguments --\n";
+$str1 = "abc1";
+$str2 = "ABC1";
+$extra_arg = 10;
+var_dump( strnatcasecmp( $str1, $str2, $extra_arg) );
+?>
+===DONE===
+--EXPECTF--
+*** Testing strnatcasecmp() : error conditions ***
+-- Testing strnatcmp() function with Zero arguments --
+
+Warning: strnatcasecmp() expects exactly 2 parameters, 0 given in %s on line %d
+NULL
+
+
+-- Testing strnatcasecmp() function with more than expected no. of arguments --
+
+Warning: strnatcasecmp() expects exactly 2 parameters, 3 given in %s on line %d
+NULL
+===DONE===
\ No newline at end of file

Added: php/php-src/trunk/ext/standard/tests/strings/strnatcmp_basic.phpt
===================================================================
--- php/php-src/trunk/ext/standard/tests/strings/strnatcmp_basic.phpt	                        (rev 0)
+++ php/php-src/trunk/ext/standard/tests/strings/strnatcmp_basic.phpt	2009-08-17 10:37:30 UTC (rev 287404)
@@ -0,0 +1,80 @@
+--TEST--
+Test strnatcmp() function : basic functionality
+--FILE--
+<?php
+/* Prototype  : int strnatcmp  ( string $str1  , string $str2  )
+ * Description: String comparisons using a "natural order" algorithm
+ * Source code: ext/standard/string.c
+*/
+echo "*** Testing strnatcmp() : basic functionality ***\n";
+
+$a1 = "abc1";
+$b1 = "abc10";
+$c1 = "abc15";
+$d1 = "abc2";
+
+$a2 = "ABC1";
+$b2 = "ABC10";
+$c2 = "ABC15";
+$d2 = "ABC2";
+
+echo "Less than tests\n";
+var_dump(strnatcmp($a1, $b1));
+var_dump(strnatcmp($a1, $c1));
+var_dump(strnatcmp($a1, $d1));
+var_dump(strnatcmp($b1, $c1));
+var_dump(strnatcmp($d1, $c1));
+
+var_dump(strnatcmp($a1, $b2));
+var_dump(strnatcmp($a1, $c2));
+var_dump(strnatcmp($a1, $d2));
+var_dump(strnatcmp($b1, $c2));
+var_dump(strnatcmp($d1, $c2));
+
+
+echo "Equal too tests\n";
+var_dump(strnatcmp($b1, $b1));
+var_dump(strnatcmp($b1, $b2));
+
+echo "Greater than tests\n";
+var_dump(strnatcmp($b1, $a1));
+var_dump(strnatcmp($c1, $a1));
+var_dump(strnatcmp($d1, $a1));
+var_dump(strnatcmp($c1, $b1));
+var_dump(strnatcmp($c1, $d1));
+
+var_dump(strnatcmp($b1, $a2));
+var_dump(strnatcmp($c1, $a2));
+var_dump(strnatcmp($d1, $a2));
+var_dump(strnatcmp($c1, $b2));
+var_dump(strnatcmp($c1, $d2));
+?>
+===DONE===
+--EXPECT--
+*** Testing strnatcmp() : basic functionality ***
+Less than tests
+int(-1)
+int(-1)
+int(-1)
+int(-1)
+int(-1)
+int(1)
+int(1)
+int(1)
+int(1)
+int(1)
+Equal too tests
+int(0)
+int(1)
+Greater than tests
+int(1)
+int(1)
+int(1)
+int(1)
+int(1)
+int(1)
+int(1)
+int(1)
+int(1)
+int(1)
+===DONE===
\ No newline at end of file

Added: php/php-src/trunk/ext/standard/tests/strings/strnatcmp_error.phpt
===================================================================
--- php/php-src/trunk/ext/standard/tests/strings/strnatcmp_error.phpt	                        (rev 0)
+++ php/php-src/trunk/ext/standard/tests/strings/strnatcmp_error.phpt	2009-08-17 10:37:30 UTC (rev 287404)
@@ -0,0 +1,34 @@
+--TEST--
+Test strnatcmp() function : error conditions
+--FILE--
+<?php
+/* Prototype  : int strnatcmp  ( string $str1  , string $str2  )
+ * Description: String comparisons using a "natural order" algorithm
+ * Source code: ext/standard/string.c
+*/
+echo "*** Testing strnatcmp() : error conditions ***\n";
+
+echo "-- Testing strnatcmp() function with Zero arguments --\n";
+var_dump( strnatcmp() );
+
+echo "\n\n-- Testing strnatcmp() function with more than expected no. of arguments --\n";
+$str1 = "abc1";
+$str2 = "ABC1";
+$extra_arg = 10;
+var_dump( strnatcmp( $str1, $str2, $extra_arg) );
+
+?>
+===DONE===
+--EXPECTF--
+*** Testing strnatcmp() : error conditions ***
+-- Testing strnatcmp() function with Zero arguments --
+
+Warning: strnatcmp() expects exactly 2 parameters, 0 given in %s on line %d
+NULL
+
+
+-- Testing strnatcmp() function with more than expected no. of arguments --
+
+Warning: strnatcmp() expects exactly 2 parameters, 3 given in %s on line %d
+NULL
+===DONE===
-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to