wharmby         Fri Jan 16 12:53:27 2009 UTC

  Added files:                 (Branch: PHP_5_3)
    /php-src/ext/standard/tests/strings count_chars_variation1.phpt 
                                        convert_uuencode_error.phpt 
                                        convert_cyr_string_basic.phpt 
                                        chr_error.phpt 
                                        convert_cyr_string_error.phpt 
                                        count_chars_variation2.phpt 
                                        bin2hex_basic.phpt 
                                        count_chars_error.phpt 
                                        convert_uudecode_basic.phpt 
                                        bug45166.phpt 
                                        bin2hex_error.phpt 
                                        chr_basic.phpt 
                                        chr_variation1.phpt 
                                        convert_cyr_string_variation1.phpt 
                                        convert_uudecode_error.phpt 
                                        convert_uudecode_variation1.phpt 
                                        convert_uuencode_basic.phpt 
                                        bin2hex_variation1.phpt 
                                        count_chars_basic.phpt 
                                        convert_uuencode_variation1.phpt 

  Modified files:              
    /php-src/ext/standard/tests/strings addslashes_variation1.phpt 
                                        bug37262.phpt 
  Log:
  New string function tests. Tested on Windows, Linux and Linux 64 bit.
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/strings/addslashes_variation1.phpt?r1=1.1.2.1.2.2&r2=1.1.2.1.2.3&diff_format=u
Index: php-src/ext/standard/tests/strings/addslashes_variation1.phpt
diff -u 
php-src/ext/standard/tests/strings/addslashes_variation1.phpt:1.1.2.1.2.2 
php-src/ext/standard/tests/strings/addslashes_variation1.phpt:1.1.2.1.2.3
--- php-src/ext/standard/tests/strings/addslashes_variation1.phpt:1.1.2.1.2.2   
Wed Jun 25 12:16:16 2008
+++ php-src/ext/standard/tests/strings/addslashes_variation1.phpt       Fri Jan 
16 12:53:27 2009
@@ -32,50 +32,50 @@
 // array with different values
 $values =  array (
 
-  // integer values
-  0,
-  1,
-  12345,
-  -2345,
-
-  // float values
-  10.5,
-  -10.5,
-  10.5e10,
-  10.6E-10,
-  .5,
-
-  // array values
-  array(),
-  array(0),
-  array(1),
-  array(1, 2),
-  array('color' => 'red', 'item' => 'pen'),
-
-  // boolean values
-  true,
-  false,
-  TRUE,
-  FALSE,
-
-  // empty string
-  "",
-  '',
-
-  // undefined variable
-  $undefined_var,
-
-  // unset variable
-  $unset_var,
-  
-  // objects
-  new sample(),
-
-  // resource
-  $file_handle,
- 
-  NULL,
-  null
+                 // integer values
+/*1*/    0,
+                 1,
+                 12345,
+                 -2345,
+               
+                 // float values
+/*5*/    10.5,
+                 -10.5,
+                 10.1234567e10,
+                 10.7654321E-10,
+                 .5,
+               
+                 // array values
+/*10*/   array(),
+                 array(0),
+                 array(1),
+                 array(1, 2),
+                 array('color' => 'red', 'item' => 'pen'),
+               
+                 // boolean values
+/*15*/   true,
+                 false,
+                 TRUE,
+                 FALSE,
+               
+                 // empty string
+/*19*/   "",
+                 '',
+               
+                 // undefined variable
+/*21*/   $undefined_var,
+               
+                 // unset variable
+/*22*/   $unset_var,
+                 
+                 // objects
+/*23*/   new sample(),
+               
+                 // resource
+/*24*/   $file_handle,
+                
+/*25*/   NULL,
+                 null
 );
 
 
@@ -95,8 +95,8 @@
 // closing the file
 fclose($file_handle);
 
-echo "Done\n";
 ?>
+===DONE===
 --EXPECTF--
 *** Testing addslashes() : with non-string type argument ***
 
@@ -118,9 +118,9 @@
 -- Iteration 6 --
 string(5) "-10.5"
 -- Iteration 7 --
-string(12) "105000000000"
+string(12) "101234567000"
 -- Iteration 8 --
-string(7) "1.06E-9"
+string(13) "1.07654321E-9"
 -- Iteration 9 --
 string(3) "0.5"
 -- Iteration 10 --
@@ -169,4 +169,4 @@
 string(0) ""
 -- Iteration 26 --
 string(0) ""
-Done
+===DONE===
\ No newline at end of file
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/strings/bug37262.phpt?r1=1.1.2.1.2.1&r2=1.1.2.1.2.2&diff_format=u
Index: php-src/ext/standard/tests/strings/bug37262.phpt
diff -u php-src/ext/standard/tests/strings/bug37262.phpt:1.1.2.1.2.1 
php-src/ext/standard/tests/strings/bug37262.phpt:1.1.2.1.2.2
--- php-src/ext/standard/tests/strings/bug37262.phpt:1.1.2.1.2.1        Sun Dec 
 9 16:54:52 2007
+++ php-src/ext/standard/tests/strings/bug37262.phpt    Fri Jan 16 12:53:27 2009
@@ -5,5 +5,5 @@
 $func = create_function('$a', 'return $a;');
 var_export($func);
 ?>
---EXPECT--     
-'' . "\0" . 'lambda_1'
+--EXPECTF--    
+'' . "\0" . 'lambda_%d'

http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/strings/count_chars_variation1.phpt?view=markup&rev=1.1
Index: php-src/ext/standard/tests/strings/count_chars_variation1.phpt
+++ php-src/ext/standard/tests/strings/count_chars_variation1.phpt
--TEST--
Test count_chars() function : usage variations - test values for $string 
argument
--FILE--
<?php

/* Prototype  : mixed count_chars  ( string $string  [, int $mode  ] )
 * Description: Return information about characters used in a string
 * Source code: ext/standard/string.c
*/

echo "*** Testing count_chars() function: with unexpected inputs for 'string' 
argument ***\n";

//get an unset variable
$unset_var = 'string_val';
unset($unset_var);

//defining a class
class sample  {
  public function __toString() {
    return "sample object";
  } 
}

//getting the resource
$file_handle = fopen(__FILE__, "r");

// array with different values for $input
$inputs =  array (

                          // integer values
/* 1 */           0,
                          1,
                          255,
                          256,
                  2147483647,
                         -2147483648,
                        
                          // float values
/* 7 */           10.5,
                          -20.5,
                          10.1234567e10,
                        
                          // array values
/* 10 */          array(),
                          array(0),
                          array(1, 2),
                        
                          // boolean values
/* 13 */          true,
                          false,
                          TRUE,
                          FALSE,
                        
                          // null values
/* 17 */          NULL,
                          null,
                        
                          // objects
/* 19 */          new sample(),
                        
                          // resource
/* 20 */          $file_handle,
                        
                          // undefined variable
/* 21 */          @$undefined_var,
                        
                          // unset variable
/* 22 */          @$unset_var
);

// loop through with each element of the $inputs array to test count_chars() 
function
$count = 1;
foreach($inputs as $input) {
  echo "-- Iteration $count --\n";
  // only list characters with a frequency > 0
  var_dump(count_chars($input, 1));
  $count ++;
}

fclose($file_handle);  //closing the file handle

?>
===DONE===
--EXPECTF--
*** Testing count_chars() function: with unexpected inputs for 'string' 
argument ***
-- Iteration 1 --
array(1) {
  [0]=>
  int(1)
}
-- Iteration 2 --
array(1) {
  [1]=>
  int(1)
}
-- Iteration 3 --
array(2) {
  [2]=>
  int(1)
  [5]=>
  int(2)
}
-- Iteration 4 --
array(3) {
  [2]=>
  int(1)
  [5]=>
  int(1)
  [6]=>
  int(1)
}
-- Iteration 5 --
array(7) {
  [2]=>
  int(1)
  [1]=>
  int(1)
  [4]=>
  int(3)
  [7]=>
  int(2)
  [8]=>
  int(1)
  [3]=>
  int(1)
  [6]=>
  int(1)
}
-- Iteration 6 --
array(8) {
  [u"-"]=>
  int(1)
  [2]=>
  int(1)
  [1]=>
  int(1)
  [4]=>
  int(3)
  [7]=>
  int(1)
  [8]=>
  int(2)
  [3]=>
  int(1)
  [6]=>
  int(1)
}
-- Iteration 7 --
array(4) {
  [1]=>
  int(1)
  [0]=>
  int(1)
  [u"."]=>
  int(1)
  [5]=>
  int(1)
}
-- Iteration 8 --
array(5) {
  [u"-"]=>
  int(1)
  [2]=>
  int(1)
  [0]=>
  int(1)
  [u"."]=>
  int(1)
  [5]=>
  int(1)
}
-- Iteration 9 --
array(8) {
  [1]=>
  int(2)
  [0]=>
  int(4)
  [2]=>
  int(1)
  [3]=>
  int(1)
  [4]=>
  int(1)
  [5]=>
  int(1)
  [6]=>
  int(1)
  [7]=>
  int(1)
}
-- Iteration 10 --

Warning: count_chars() expects parameter 1 to be string (Unicode or binary), 
array given in %s on line %d
NULL
-- Iteration 11 --

Warning: count_chars() expects parameter 1 to be string (Unicode or binary), 
array given in %s on line %d
NULL
-- Iteration 12 --

Warning: count_chars() expects parameter 1 to be string (Unicode or binary), 
array given in %s on line %d
NULL
-- Iteration 13 --
array(1) {
  [1]=>
  int(1)
}
-- Iteration 14 --
array(0) {
}
-- Iteration 15 --
array(1) {
  [1]=>
  int(1)
}
-- Iteration 16 --
array(0) {
}
-- Iteration 17 --
array(0) {
}
-- Iteration 18 --
array(0) {
}
-- Iteration 19 --
array(12) {
  [u"s"]=>
  int(1)
  [u"a"]=>
  int(1)
  [u"m"]=>
  int(1)
  [u"p"]=>
  int(1)
  [u"l"]=>
  int(1)
  [u"e"]=>
  int(2)
  [u" "]=>
  int(1)
  [u"o"]=>
  int(1)
  [u"b"]=>
  int(1)
  [u"j"]=>
  int(1)
  [u"c"]=>
  int(1)
  [u"t"]=>
  int(1)
}
-- Iteration 20 --

Warning: count_chars() expects parameter 1 to be string (Unicode or binary), 
resource given in %s on line %d
NULL
-- Iteration 21 --
array(0) {
}
-- Iteration 22 --
array(0) {
}
===DONE===

http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/strings/convert_uuencode_error.phpt?view=markup&rev=1.1
Index: php-src/ext/standard/tests/strings/convert_uuencode_error.phpt
+++ php-src/ext/standard/tests/strings/convert_uuencode_error.phpt
--TEST--
Test convert_uuencode() function : error conditions 
--FILE--
<?php

/* Prototype  : string convert_uuencode  ( string $data  )
 * Description: Uuencode a string
 * Source code: ext/standard/uuencode.c
*/

echo "*** Testing convert_uuencode() : error conditions ***\n";

echo "\n-- Testing chconvert_uuencoder() function with no arguments --\n";
var_dump( convert_uuencode() );

echo "\n-- Testing convert_uuencode() function with more than expected no. of 
arguments --\n";
$extra_arg = 10;
var_dump( convert_uuencode(72, $extra_arg) );

?> 
===DONE===
--EXPECTF--
*** Testing convert_uuencode() : error conditions ***

-- Testing chconvert_uuencoder() function with no arguments --

Warning: convert_uuencode() expects exactly 1 parameter, 0 given in %s on line 
%d
bool(false)

-- Testing convert_uuencode() function with more than expected no. of arguments 
--

Warning: convert_uuencode() expects exactly 1 parameter, 2 given in %s on line 
%d
bool(false)
 
===DONE===

http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/strings/convert_cyr_string_basic.phpt?view=markup&rev=1.1
Index: php-src/ext/standard/tests/strings/convert_cyr_string_basic.phpt
+++ php-src/ext/standard/tests/strings/convert_cyr_string_basic.phpt
--TEST--
Test convert_cyr_string() function : basic functionality 
--FILE--
<?php

/* Prototype  : string convert_cyr_string  ( string $str  , string $from  , 
string $to  )
 * Description: Convert from one Cyrillic character set to another
 * Source code: ext/standard/string.c
*/

echo "*** Testing convert_cyr_string() : basic functionality ***\n";

$str = b"Convert from one Cyrillic character set to another.";

echo "\n-- First try some simple English text --\n";
var_dump(bin2hex(convert_cyr_string($str, 'w', 'k')));
var_dump(bin2hex(convert_cyr_string($str, 'w', 'i')));


echo "\n-- Now try some of characters in 128-255 range --\n";

$i = 128;
echo "$i: \n"; 
echo bin2hex(convert_cyr_string(chr($i), 'w', 'k')) . "\n";
$i = 200;
echo "$i: \n"; 
echo bin2hex(convert_cyr_string(chr($i), 'w', 'k')) . "\n";
$i = 255;
echo "$i: \n"; 
echo bin2hex(convert_cyr_string(chr($i), 'w', 'k')) . "\n";

?>
===DONE===
--EXPECTF--
*** Testing convert_cyr_string() : basic functionality ***

-- First try some simple English text --
unicode(102) 
"436f6e766572742066726f6d206f6e6520437972696c6c6963206368617261637465722073657420746f20616e6f746865722e"
unicode(102) 
"436f6e766572742066726f6d206f6e6520437972696c6c6963206368617261637465722073657420746f20616e6f746865722e"

-- Now try some of characters in 128-255 range --
128: 

Warning: convert_cyr_string() expects parameter 1 to be strictly a binary 
string, Unicode string given in %s on line %d

200: 

Warning: convert_cyr_string() expects parameter 1 to be strictly a binary 
string, Unicode string given in %s on line %d

255: 

Warning: convert_cyr_string() expects parameter 1 to be strictly a binary 
string, Unicode string given in %s on line %d

===DONE===

http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/strings/chr_error.phpt?view=markup&rev=1.1
Index: php-src/ext/standard/tests/strings/chr_error.phpt
+++ php-src/ext/standard/tests/strings/chr_error.phpt
--TEST--
Test chr() function : error conditions
--FILE--
<?php

/* Prototype  : string chr  ( int $ascii  )
 * Description: Return a specific character
 * Source code: ext/standard/string.c
*/

echo "*** Testing chr() : error conditions ***\n";

echo "\n-- Testing chr() function with no arguments --\n";
var_dump( chr() );

echo "\n-- Testing chr() function with more than expected no. of arguments 
--\n";
$extra_arg = 10;
var_dump( chr(72, $extra_arg) );

?>
===DONE===
--EXPECTF--
*** Testing chr() : error conditions ***

-- Testing chr() function with no arguments --

Warning: chr() expects exactly 1 parameter, 0 given in %s on line %d
NULL

-- Testing chr() function with more than expected no. of arguments --

Warning: chr() expects exactly 1 parameter, 2 given in %s on line %d
NULL
===DONE===

http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/strings/convert_cyr_string_error.phpt?view=markup&rev=1.1
Index: php-src/ext/standard/tests/strings/convert_cyr_string_error.phpt
+++ php-src/ext/standard/tests/strings/convert_cyr_string_error.phpt
--TEST--
Test convert_cyr_string() function : error conditions 
--FILE--
<?php

/* Prototype  : string convert_cyr_string  ( string $str  , string $from  , 
string $to  )
 * Description: Convert from one Cyrillic character set to another
 * Source code: ext/standard/string.c
*/

$str = b"hello";
$from = "k";
$to = "d";
$extra_arg = 10;

echo "*** Testing convert_cyr_string() : error conditions ***\n";

echo "\n-- Testing convert_cyr_string() function with no arguments --\n";
var_dump( convert_cyr_string() );

echo "\n-- Testing convert_cyr_string() function with no 'to' character set 
--\n";
var_dump( convert_cyr_string($str, $from) );

echo "\n-- Testing convert_cyr_string() function with more than expected no. of 
arguments --\n";
var_dump( convert_cyr_string($str, $from, $to, $extra_arg) );

echo "\n-- Testing convert_cyr_string() function with invalid 'from' character 
set --\n";
var_dump(bin2hex( convert_cyr_string($str, "?", $to) ));

echo "\n-- Testing convert_cyr_string() function with invalid 'to' character 
set --\n";
var_dump(bin2hex( convert_cyr_string($str, $from, "?")) );

echo "\n-- Testing convert_cyr_string() function with invalid 'from' and 'to' 
character set --\n";
var_dump(bin2hex( convert_cyr_string($str, ">", "?")) );

?> 
===DONE===
--EXPECTF--
*** Testing convert_cyr_string() : error conditions ***

-- Testing convert_cyr_string() function with no arguments --

Warning: convert_cyr_string() expects exactly 3 parameters, 0 given in %s on 
line %d
NULL

-- Testing convert_cyr_string() function with no 'to' character set --

Warning: convert_cyr_string() expects exactly 3 parameters, 2 given in %s on 
line %d
NULL

-- Testing convert_cyr_string() function with more than expected no. of 
arguments --

Warning: convert_cyr_string() expects exactly 3 parameters, 4 given in %s on 
line %d
NULL

-- Testing convert_cyr_string() function with invalid 'from' character set --

Warning: convert_cyr_string(): Unknown source charset: ? in %s on line %d
unicode(10) "68656c6c6f"

-- Testing convert_cyr_string() function with invalid 'to' character set --

Warning: convert_cyr_string(): Unknown destination charset: ? in %s on line %d
unicode(10) "68656c6c6f"

-- Testing convert_cyr_string() function with invalid 'from' and 'to' character 
set --

Warning: convert_cyr_string(): Unknown source charset: > in %s on line %d

Warning: convert_cyr_string(): Unknown destination charset: ? in %s on line %d
unicode(10) "68656c6c6f"
 
===DONE===

http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/strings/count_chars_variation2.phpt?view=markup&rev=1.1
Index: php-src/ext/standard/tests/strings/count_chars_variation2.phpt
+++ php-src/ext/standard/tests/strings/count_chars_variation2.phpt
--TEST--
Test count_chars() function : usage variations - test values for $mode argument
--FILE--
<?php

/* Prototype  : mixed count_chars  ( string $string  [, int $mode  ] )
 * Description: Return information about characters used in a string
 * Source code: ext/standard/string.c
*/

echo "*** Testing count_chars() function: with unexpected inputs for 'mode' 
argument ***\n";

//get an unset variable
$unset_var = 'string_val';
unset($unset_var);

//defining a class
class sample  {
}

// array with different values for $input
$inputs =  array (

                          // integer values
/* 1 */           0,
                          1,
                          255,
                          2147483647,
                      -2147483648,
                        
                          // float values
/* 6 */           0.0,
                          1.3,
                          10.5,
                          -20.5,
                          10.1234567e10,
                        
                          // array values
/* 11 */          array(),
                          array(1, 2, 3, 4, 5, 6, 7, 8, 9),
                        
                          // boolean values
/* 14 */          true,
                          false,
                          TRUE,
                          FALSE,
                        
                          // null values
/* 18 */          NULL,
                          null,
                          
                          // string values
/* 20 */          "ABCD",
                          'abcd',
                          "1ABC",
                          "5ABC",
                          
                          // objects
/* 24 */          new sample(),
                        
                           // undefined variable
/* 25 */          @$undefined_var,
                        
                          // unset variable
/* 26 */          @$unset_var
);

// loop through with each element of the $inputs array to test count_chars() 
function
// with unexepcted values for the 'mode' argument
$count = 1;
$string = "Return information about characters used in a string";
foreach($inputs as $input) {
  echo "-- Iteration $count --\n";
  // only list characters with a frequency > 0
  var_dump(is_array(count_chars($string, $input)));
  $count ++;
}


?>
===DONE===
--EXPECTF--
*** Testing count_chars() function: with unexpected inputs for 'mode' argument 
***
-- Iteration 1 --

Warning: count_chars(): Only mode=1 is supported with Unicode strings in %s on 
line %d
bool(false)
-- Iteration 2 --
bool(true)
-- Iteration 3 --

Warning: count_chars(): Unknown mode in %s on line %d
bool(false)
-- Iteration 4 --

Warning: count_chars(): Unknown mode in %s on line %d
bool(false)
-- Iteration 5 --

Warning: count_chars(): Unknown mode in %s on line %d
bool(false)
-- Iteration 6 --

Warning: count_chars(): Only mode=1 is supported with Unicode strings in %s on 
line %d
bool(false)
-- Iteration 7 --
bool(true)
-- Iteration 8 --

Warning: count_chars(): Unknown mode in %s on line %d
bool(false)
-- Iteration 9 --

Warning: count_chars(): Unknown mode in %s on line %d
bool(false)
-- Iteration 10 --

Warning: count_chars(): Unknown mode in %s on line %d
bool(false)
-- Iteration 11 --

Warning: count_chars() expects parameter 2 to be long, array given in %s on 
line %d
bool(false)
-- Iteration 12 --

Warning: count_chars() expects parameter 2 to be long, array given in %s on 
line %d
bool(false)
-- Iteration 13 --
bool(true)
-- Iteration 14 --

Warning: count_chars(): Only mode=1 is supported with Unicode strings in %s on 
line %d
bool(false)
-- Iteration 15 --
bool(true)
-- Iteration 16 --

Warning: count_chars(): Only mode=1 is supported with Unicode strings in %s on 
line %d
bool(false)
-- Iteration 17 --

Warning: count_chars(): Only mode=1 is supported with Unicode strings in %s on 
line %d
bool(false)
-- Iteration 18 --

Warning: count_chars(): Only mode=1 is supported with Unicode strings in %s on 
line %d
bool(false)
-- Iteration 19 --

Warning: count_chars() expects parameter 2 to be long, Unicode string given in 
%s on line %d
bool(false)
-- Iteration 20 --

Warning: count_chars() expects parameter 2 to be long, Unicode string given in 
%s on line %d
bool(false)
-- Iteration 21 --

Notice: A non well formed numeric value encountered in %s on line %d
bool(true)
-- Iteration 22 --

Notice: A non well formed numeric value encountered in %s on line %d

Warning: count_chars(): Unknown mode in %s on line %d
bool(false)
-- Iteration 23 --

Warning: count_chars() expects parameter 2 to be long, object given in %s on 
line %d
bool(false)
-- Iteration 24 --

Warning: count_chars(): Only mode=1 is supported with Unicode strings in %s on 
line %d
bool(false)
-- Iteration 25 --

Warning: count_chars(): Only mode=1 is supported with Unicode strings in %s on 
line %d
bool(false)
===DONE===

http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/strings/bin2hex_basic.phpt?view=markup&rev=1.1
Index: php-src/ext/standard/tests/strings/bin2hex_basic.phpt
+++ php-src/ext/standard/tests/strings/bin2hex_basic.phpt
--TEST--
Test bin2hex() function : basic functionality 
--FILE--
<?php

/* Prototype  : string bin2hex  ( string $str  )
 * Description: Convert binary data into hexadecimal representation
 * Source code: ext/standard/string.c
*/

echo "*** Testing bin2hex() : basic functionality ***\n";

// array with different values for $string
$strings =  array (

  //double quoted strings
  b"Here is a simple string",
  b"\t This String contains \t\t some control characters\r\n",
  b"\x90\x91\x00\x93\x94\x90\x91\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f",
  
   //single quoted strings
  b'Here is a simple string',
  b'\t This String contains \t\t some control characters\r\n',
  b'\x90\x91\x00\x93\x94\x90\x91\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f',
);  

// loop through with each element of the $strings array to test bin2hex() 
function
$count = 1;
foreach($strings as $string) {
  echo "-- Iteration $count --\n";      
  var_dump(bin2hex($string));
  $count ++;
}  
?>
===DONE===
--EXPECT--
*** Testing bin2hex() : basic functionality ***
-- Iteration 1 --
unicode(46) "4865726520697320612073696d706c6520737472696e67"
-- Iteration 2 --
unicode(102) 
"09205468697320537472696e6720636f6e7461696e7320090920736f6d6520636f6e74726f6c20636861726163746572730d0a"
-- Iteration 3 --
unicode(36) "9091009394909195969798999a9b9c9d9e9f"
-- Iteration 4 --
unicode(46) "4865726520697320612073696d706c6520737472696e67"
-- Iteration 5 --
unicode(112) 
"5c74205468697320537472696e6720636f6e7461696e73205c745c7420736f6d6520636f6e74726f6c20636861726163746572735c725c6e"
-- Iteration 6 --
unicode(144) 
"5c7839305c7839315c7830305c7839335c7839345c7839305c7839315c7839355c7839365c7839375c7839385c7839395c7839615c7839625c7839635c7839645c7839655c783966"
===DONE===

http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/strings/count_chars_error.phpt?view=markup&rev=1.1
Index: php-src/ext/standard/tests/strings/count_chars_error.phpt
+++ php-src/ext/standard/tests/strings/count_chars_error.phpt
--TEST--
Test count_chars() function : error conditions
--FILE--
<?php

/* Prototype  : mixed count_chars  ( string $string  [, int $mode  ] )
 * Description: Return information about characters used in a string
 * Source code: ext/standard/string.c
*/

echo "*** Testing count_chars() : error conditions ***\n";

echo "\n-- Testing count_chars() function with no arguments --\n";
var_dump( count_chars() );

echo "\n-- Testing count_chars() function with more than expected no. of 
arguments --\n";
$string = "Hello World\n"; 
$mode = 1;
$extra_arg = 10;
var_dump( count_chars($string, $mode, $extra_arg) );

?>
===DONE===
--EXPECTF--
*** Testing count_chars() : error conditions ***

-- Testing count_chars() function with no arguments --

Warning: count_chars() expects at least 1 parameter, 0 given in %s on line %d
NULL

-- Testing count_chars() function with more than expected no. of arguments --

Warning: count_chars() expects at most 2 parameters, 3 given in %s on line %d
NULL
===DONE===

http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/strings/convert_uudecode_basic.phpt?view=markup&rev=1.1
Index: php-src/ext/standard/tests/strings/convert_uudecode_basic.phpt
+++ php-src/ext/standard/tests/strings/convert_uudecode_basic.phpt
--TEST--
Test convert_uudecode() function : basic functionality 
--FILE--
<?php

/* Prototype  : string convert_uudecode  ( string $data  )
 * Description: Decode a uuencoded string
 * Source code: ext/standard/uuencode.c
*/

echo "*** Testing convert_uudecode() : basic functionality ***\n";

// array with different values for $string
$strings =  array (

  //double quoted strings
  b"123",
  b"abc",
  b"1a2b3c",
  b"Here is a simple string to test convert_uuencode/decode",
  b"\t This String contains \t\t some control characters\r\n",
  b"\x90\x91\x00\x93\x94\x90\x91\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f",
  
   //single quoted strings
  b'123',
  b'abc',
  b'1a2b3c',
  b'\t This String contains \t\t some control characters\r\n',
  
);  

// loop through with each element of the $strings array to test 
convert_uudecode() function
$count = 1;
foreach($strings as $string) {
        
  $encode = convert_uuencode($string);
  $decode = convert_uudecode($encode);
  
  if ($decode != $string) { 
        var_dump($encode, $decode, $string);  
        exit("TEST FAILED on iteration $count\n");
  }     
  
  $count ++;
}

echo "TEST PASSED\n";

?>
===DONE=== 
--EXPECTF--
*** Testing convert_uudecode() : basic functionality ***
TEST PASSED
===DONE===

http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/strings/bug45166.phpt?view=markup&rev=1.1
Index: php-src/ext/standard/tests/strings/bug45166.phpt
+++ php-src/ext/standard/tests/strings/bug45166.phpt
--TEST--
Bug #45166 (substr() )
--FILE--
<?php
        echo substr('cd', -3) . "\n";  
?>
===DONE===
--EXPECT--
cd
===DONE===

http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/strings/bin2hex_error.phpt?view=markup&rev=1.1
Index: php-src/ext/standard/tests/strings/bin2hex_error.phpt
+++ php-src/ext/standard/tests/strings/bin2hex_error.phpt
--TEST--
Test bin2hex() function : error conditions 
--FILE--
<?php

/* Prototype  : string bin2hex  ( string $str  )
 * Description: Convert binary data into hexadecimal representation
 * Source code: ext/standard/string.c
*/

echo "*** Testing bin2hex() : error conditions ***\n";

echo "\n-- Testing bin2hex() function with no arguments --\n";
var_dump( bin2hex() );

echo "\n-- Testing bin2hex() function with more than expected no. of arguments 
--\n";
$extra_arg = 10;
var_dump( bin2hex("Hello World", $extra_arg) );

echo "\n-- Testing bin2hex() function with Unicode string --\n";
var_dump( bin2hex("Hello World") );

?> 
===DONE===
--EXPECTF--
*** Testing bin2hex() : error conditions ***

-- Testing bin2hex() function with no arguments --

Warning: bin2hex() expects exactly 1 parameter, 0 given in %s on line %d
NULL

-- Testing bin2hex() function with more than expected no. of arguments --

Warning: bin2hex() expects exactly 1 parameter, 2 given in %s on line %d
NULL

-- Testing bin2hex() function with Unicode string --

Warning: bin2hex() expects parameter 1 to be strictly a binary string, Unicode 
string given in %s on line %d
NULL
 
===DONE===

http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/strings/chr_basic.phpt?view=markup&rev=1.1
Index: php-src/ext/standard/tests/strings/chr_basic.phpt
+++ php-src/ext/standard/tests/strings/chr_basic.phpt
--TEST--
Test chr() function : basic functionality 
--FILE--
<?php

/* Prototype  : string chr  ( int $ascii  )
 * Description: Return a specific character
 * Source code: ext/standard/string.c
*/

echo "*** Testing chr() : basic functionality ***\n";

echo chr(72);
echo chr(101);
echo chr(108);
echo chr(108);
echo chr(111);
echo chr(10);
echo "World";
echo "\n";
?>
===DONE===
--EXPECTF--
*** Testing chr() : basic functionality ***
Hello
World
===DONE===

http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/strings/chr_variation1.phpt?view=markup&rev=1.1
Index: php-src/ext/standard/tests/strings/chr_variation1.phpt
+++ php-src/ext/standard/tests/strings/chr_variation1.phpt
--TEST--
Test chr() function : usage variations - test values for $ascii argument
--FILE--
<?php

/* Prototype  : string chr  ( int $ascii  )
 * Description: Return a specific character
 * Source code: ext/standard/string.c
*/

echo "*** Testing chr() function: with unexpected inputs for 'ascii' argument 
***\n";

//get an unset variable
$unset_var = 'string_val';
unset($unset_var);

//defining a class
class sample  {
  public function __toString() {
    return "sample object";
  } 
}

//getting the resource
$file_handle = fopen(__FILE__, "r");

// array with different values for $input
$inputs =  array (

                  // integer values
/*1*/     0,
                  1,
                  255,
                  256,
                
                  // float values
/*5*/     10.5,
                  -20.5,
                  1.1234e6,
                
                  // array values
/*8*/     array(),
                  array(0),
                  array(1, 2),
                
                  // boolean values
/*11*/    true,
                  false,
                  TRUE,
                  FALSE,
                
                  // null values
/*15*/    NULL,
                  null,
                
                  // objects
/*17*/    new sample(),
                
                  // resource
/*18*/    $file_handle,
                
                  // undefined variable
/*19*/    @$undefined_var,
                
                  // unset variable
/*20*/    @$unset_var
);

// loop through with each element of the $inputs array to test chr() function
$count = 1;
foreach($inputs as $input) {
  echo "-- Iteration $count --\n";
  var_dump( bin2hex((binary)chr($input)) );
  $count ++;
}

fclose($file_handle);  //closing the file handle

?>
===DONE===
--EXPECTF--
*** Testing chr() function: with unexpected inputs for 'ascii' argument ***
-- Iteration 1 --
unicode(2) "00"
-- Iteration 2 --
unicode(2) "01"
-- Iteration 3 --
unicode(2) "ff"
-- Iteration 4 --
unicode(2) "3f"
-- Iteration 5 --
unicode(2) "0a"
-- Iteration 6 --
unicode(4) "3f3f"
-- Iteration 7 --

Warning: Codepoint value cannot be greater than 10FFFF in %s on line %d
unicode(0) ""
-- Iteration 8 --

Warning: chr() expects parameter 1 to be long, array given in %s on line %d
unicode(0) ""
-- Iteration 9 --

Warning: chr() expects parameter 1 to be long, array given in %s on line %d
unicode(0) ""
-- Iteration 10 --

Warning: chr() expects parameter 1 to be long, array given in %s on line %d
unicode(0) ""
-- Iteration 11 --
unicode(2) "01"
-- Iteration 12 --
unicode(2) "00"
-- Iteration 13 --
unicode(2) "01"
-- Iteration 14 --
unicode(2) "00"
-- Iteration 15 --
unicode(2) "00"
-- Iteration 16 --
unicode(2) "00"
-- Iteration 17 --

Warning: chr() expects parameter 1 to be long, object given in %s on line %d
unicode(0) ""
-- Iteration 18 --

Warning: chr() expects parameter 1 to be long, resource given in %s on line %d
unicode(0) ""
-- Iteration 19 --
unicode(2) "00"
-- Iteration 20 --
unicode(2) "00"
===DONE===

http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/strings/convert_cyr_string_variation1.phpt?view=markup&rev=1.1
Index: php-src/ext/standard/tests/strings/convert_cyr_string_variation1.phpt
+++ php-src/ext/standard/tests/strings/convert_cyr_string_variation1.phpt
--TEST--
Test convert_cyr_string() function : usage variations - test values for $str 
argument
--FILE--
<?php

/* Prototype  : string convert_cyr_string  ( string $str  , string $from  , 
string $to  )
 * Description: Convert from one Cyrillic character set to another
 * Source code: ext/standard/string.c
*/

echo "*** Testing convert_cyr_string() function: with unexpected inputs for 
'str' argument ***\n";

//get an unset variable
$unset_var = 'string_val';
unset($unset_var);

//defining a class
class sample  {
  public function __toString() {
    return "sample object";
  } 
}

//getting the resource
$file_handle = fopen(__FILE__, "r");

// array with different values for $str
$inputs =  array (

                  // integer values
/*1*/     0,
                  1,
                  255,
                  256,
                  2147483647,
                  -2147483648,
                
                  // float values
/*7*/     10.5,
                  -20.5,
                  10.1234567e10,
                
                  // array values
/*10*/    array(),
                  array(0),
                  array(1, 2),
                
                  // boolean values
/*13*/    true,
                  false,
                  TRUE,
                  FALSE,
                
                  // null values
/*17*/    NULL,
                  null,
                
                  // objects
/*19*/    new sample(),
                
                  // resource
/*20*/    $file_handle,
                
                  // undefined variable
/*21*/    @$undefined_var,
                
                  // unset variable
/*22*/    @$unset_var
);

// loop through with each element of the $inputs array to test 
convert_cyr_string() function
$count = 1;
$from = "w";
$to = "k";
foreach($inputs as $input) {
  echo "-- Iteration $count --\n";
  var_dump( convert_cyr_string($input, $from, $to) );
  $count ++;
}

fclose($file_handle);  //closing the file handle

?>
===DONE===
--EXPECTF--
*** Testing convert_cyr_string() function: with unexpected inputs for 'str' 
argument ***
-- Iteration 1 --
string(1) "0"
-- Iteration 2 --
string(1) "1"
-- Iteration 3 --
string(3) "255"
-- Iteration 4 --
string(3) "256"
-- Iteration 5 --
string(10) "2147483647"
-- Iteration 6 --
string(11) "-2147483648"
-- Iteration 7 --
string(4) "10.5"
-- Iteration 8 --
string(5) "-20.5"
-- Iteration 9 --
string(12) "101234567000"
-- Iteration 10 --

Warning: convert_cyr_string() expects parameter 1 to be binary string, array 
given in %s on line %d
NULL
-- Iteration 11 --

Warning: convert_cyr_string() expects parameter 1 to be binary string, array 
given in %s on line %d
NULL
-- Iteration 12 --

Warning: convert_cyr_string() expects parameter 1 to be binary string, array 
given in %s on line %d
NULL
-- Iteration 13 --
string(1) "1"
-- Iteration 14 --
string(0) ""
-- Iteration 15 --
string(1) "1"
-- Iteration 16 --
string(0) ""
-- Iteration 17 --
string(0) ""
-- Iteration 18 --
string(0) ""
-- Iteration 19 --
string(13) "sample object"
-- Iteration 20 --

Warning: convert_cyr_string() expects parameter 1 to be binary string, resource 
given in %s on line %d
NULL
-- Iteration 21 --
string(0) ""
-- Iteration 22 --
string(0) ""
===DONE===

http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/strings/convert_uudecode_error.phpt?view=markup&rev=1.1
Index: php-src/ext/standard/tests/strings/convert_uudecode_error.phpt
+++ php-src/ext/standard/tests/strings/convert_uudecode_error.phpt
--TEST--
Test convert_uudecode() function : error conditions 
--FILE--
<?php

/* Prototype  : string convert_uudecode  ( string $data  )
 * Description: Decode a uuencoded string
 * Source code: ext/standard/uuencode.c
*/

echo "*** Testing convert_uudecode() : error conditions ***\n";

echo "\n-- Testing convert_uudecode() function with no arguments --\n";
var_dump( convert_uudecode() );

echo "\n-- Testing convert_uudecode() function with more than expected no. of 
arguments --\n";
$extra_arg = 10;
var_dump( convert_uudecode(72, $extra_arg) );

?> 
===DONE===
--EXPECTF--
*** Testing convert_uudecode() : error conditions ***

-- Testing convert_uudecode() function with no arguments --

Warning: convert_uudecode() expects exactly 1 parameter, 0 given in %s on line 
%d
bool(false)

-- Testing convert_uudecode() function with more than expected no. of arguments 
--

Warning: convert_uudecode() expects exactly 1 parameter, 2 given in %s on line 
%d
bool(false)
 
===DONE===

http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/strings/convert_uudecode_variation1.phpt?view=markup&rev=1.1
Index: php-src/ext/standard/tests/strings/convert_uudecode_variation1.phpt
+++ php-src/ext/standard/tests/strings/convert_uudecode_variation1.phpt
--TEST--
Test convert_uudecode() function : usage variations - test values for $data 
argument
--FILE--
<?php

/* Prototype  : string convert_uudecode  ( string $data  )
 * Description: Decode a uuencoded string
 * Source code: ext/standard/uuencode.c
*/

echo "*** Testing convert_uudecode() function: with unexpected inputs for 
'data' argument ***\n";

//get an unset variable
$unset_var = 'string_val';
unset($unset_var);

//defining a class
class sample  {
  public function __toString() {
    return "sample object";
  } 
}

//getting the resource
$file_handle = fopen(__FILE__, "r");

// array with different values for $data
$inputs =  array (

                  // integer values
/*1*/     0,
                  1,
                  255,
                  256,
                  2147483647,
                  -2147483648,
                
                  // float values
/*7*/     10.5,
                  -20.5,
                  10.1234567e10,
                
                  // array values
/*10*/    array(),
                  array(0),
                  array(1, 2),
                
                  // boolean values
/*13*/    true,
                  false,
                  TRUE,
                  FALSE,
                
                  // null values
/*17*/    NULL,
                  null,
                
                  // objects
/*19*/    new sample(),
                
                  // resource
/*20*/    $file_handle,
                
                  // undefined variable
/*21*/    @$undefined_var,
                
                  // unset variable
/*22*/    @$unset_var
);

// loop through with each element of the $data array to test convert_uudecode() 
function
$count = 1;
foreach($inputs as $input) {
  echo "-- Iteration $count --\n";
  var_dump( convert_uudecode($input) );
  $count ++;
}

fclose($file_handle);  //closing the file handle

?>
===DONE===
--EXPECTF--
*** Testing convert_uudecode() function: with unexpected inputs for 'data' 
argument ***
-- Iteration 1 --

Warning: convert_uudecode(): The given parameter is not a valid uuencoded 
string in %s on line %d
bool(false)
-- Iteration 2 --

Warning: convert_uudecode(): The given parameter is not a valid uuencoded 
string in %s on line %d
bool(false)
-- Iteration 3 --

Warning: convert_uudecode(): The given parameter is not a valid uuencoded 
string in %s on line %d
bool(false)
-- Iteration 4 --

Warning: convert_uudecode(): The given parameter is not a valid uuencoded 
string in %s on line %d
bool(false)
-- Iteration 5 --

Warning: convert_uudecode(): The given parameter is not a valid uuencoded 
string in %s on line %d
bool(false)
-- Iteration 6 --

Warning: convert_uudecode(): The given parameter is not a valid uuencoded 
string in %s on line %d
bool(false)
-- Iteration 7 --

Warning: convert_uudecode(): The given parameter is not a valid uuencoded 
string in %s on line %d
bool(false)
-- Iteration 8 --

Warning: convert_uudecode(): The given parameter is not a valid uuencoded 
string in %s
bool(false)
-- Iteration 9 --

Warning: convert_uudecode(): The given parameter is not a valid uuencoded 
string in %s
bool(false)
-- Iteration 10 --

Warning: convert_uudecode() expects parameter 1 to be string (Unicode or 
binary), array given in %s
bool(false)
-- Iteration 11 --

Warning: convert_uudecode() expects parameter 1 to be string (Unicode or 
binary), array given in %s
bool(false)
-- Iteration 12 --

Warning: convert_uudecode() expects parameter 1 to be string (Unicode or 
binary), array given in %s
bool(false)
-- Iteration 13 --

Warning: convert_uudecode(): The given parameter is not a valid uuencoded 
string in %s
bool(false)
-- Iteration 14 --
bool(false)
-- Iteration 15 --

Warning: convert_uudecode(): The given parameter is not a valid uuencoded 
string in %s
bool(false)
-- Iteration 16 --
bool(false)
-- Iteration 17 --
bool(false)
-- Iteration 18 --
bool(false)
-- Iteration 19 --

Warning: convert_uudecode(): The given parameter is not a valid uuencoded 
string in %s
bool(false)
-- Iteration 20 --

Warning: convert_uudecode() expects parameter 1 to be string (Unicode or 
binary), resource given in %s
bool(false)
-- Iteration 21 --
bool(false)
-- Iteration 22 --
bool(false)
===DONE===
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/strings/convert_uuencode_basic.phpt?view=markup&rev=1.1
Index: php-src/ext/standard/tests/strings/convert_uuencode_basic.phpt
+++ php-src/ext/standard/tests/strings/convert_uuencode_basic.phpt
--TEST--
Test convert_uuencode() function : basic functionality 
--FILE--
<?php

/* Prototype  : string convert_uuencode  ( string $data  )
 * Description: Uuencode a string
 * Source code: ext/standard/uuencode.c
*/

echo "*** Testing convert_uuencode() : basic functionality ***\n";

// array with different values for $string
$strings =  array (

  //double quoted strings
  b"123",
  b"abc",
  b"1a2b3c",
  b"Here is a simple string to test convert_uuencode/decode",
  b"\t This String contains \t\t some control characters\r\n",
  b"\x90\x91\x00\x93\x94\x90\x91\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f",
  
   //single quoted strings
  b'123',
  b'abc',
  b'1a2b3c',
  b'\t This String contains \t\t some control characters\r\n',
  
);  

// loop through with each element of the $strings array to test 
convert_uuencode() function
$count = 1;
foreach($strings as $string) {
  echo "-- Iteration $count --\n";
  var_dump( convert_uuencode($string) );
  $count ++;
}


?>
===DONE=== 
--EXPECTF--
*** Testing convert_uuencode() : basic functionality ***
-- Iteration 1 --
unicode(8) "#,3(S
`
"
-- Iteration 2 --
unicode(8) "#86)C
`
"
-- Iteration 3 --
unicode(12) "&,6$R8C-C
`
"
-- Iteration 4 --
unicode(82) "M2&5R92!I<R!A('-I;7!L92!S=')I;F<@=&\...@=&5S="!C;VYV97)T7W5U96YC
*;V1E+V1E8V]D90``
`
"
-- Iteration 5 --
unicode(74) "M"2!4:&ES(%-T<FEN9R!C;VYT86EN<R`)"2!S;VUE(&-O;G1R;v...@8vaa<F%C
&=&5R<PT*
`
"
-- Iteration 6 --
unicode(28) "2D)$`DY20D966EYB9FIN<G9Z?
`
"
-- Iteration 7 --
unicode(8) "#,3(S
`
"
-- Iteration 8 --
unicode(8) "#86)C
`
"
-- Iteration 9 --
unicode(12) "&,6$R8C-C
`
"
-- Iteration 10 --
unicode(82) "M7'0...@5&AI<R!3=')I;F<@8V]N=&%I;G,@7'1<="!S;VUE(&-O;G1R;v...@8vaa
+<F%C=&5R<UQR7&X`
`
"
===DONE===

http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/strings/bin2hex_variation1.phpt?view=markup&rev=1.1
Index: php-src/ext/standard/tests/strings/bin2hex_variation1.phpt
+++ php-src/ext/standard/tests/strings/bin2hex_variation1.phpt
--TEST--
Test bin2hex() function : usage variations - test values for $str argument
--FILE--
<?php

/* Prototype  : string bin2hex  ( string $str  )
 * Description: Convert binary data into hexadecimal representation
 * Source code: ext/standard/string.c
*/

echo "*** Testing bin2hex() function: with unexpected inputs for 'str' argument 
***\n";

//get an unset variable
$unset_var = 'string_val';
unset($unset_var);

//defining a class
class sample  {
  public function __toString() {
    return "sample object";
  } 
}

//getting the resource
$file_handle = fopen(__FILE__, "r");

// array with different values for $input
$inputs =  array (

          // integer values
/*1*/ 0,
          1,
          123456,
        
          // float values
/*4*/ 10.5,
          -20.5,
          10.1234567e10,
        
          // array values
/*7*/ array(),
          array(0),
          array(1, 2),
        
          // boolean values
/*10*/true,
          false,
          TRUE,
          FALSE,
        
          // null values
/*14*/NULL,
          null,
        
          // objects
/*16*/new sample(),
        
          // resource
/*17*/$file_handle,
        
          // undefined variable
/*18*/@$undefined_var,
        
          // unset variable
/*19*/@$unset_var
);

// loop through with each element of the $inputs array to test bin2hex() 
function
$count = 1;
foreach($inputs as $input) {
  echo "-- Iteration $count --\n";
  var_dump(bin2hex($input) );
  $count ++;
}

fclose($file_handle);  //closing the file handle

?>
===DONE===
--EXPECTF--
*** Testing bin2hex() function: with unexpected inputs for 'str' argument ***
-- Iteration 1 --
unicode(2) "30"
-- Iteration 2 --
unicode(2) "31"
-- Iteration 3 --
unicode(12) "313233343536"
-- Iteration 4 --
unicode(8) "31302e35"
-- Iteration 5 --
unicode(10) "2d32302e35"
-- Iteration 6 --
unicode(24) "313031323334353637303030"
-- Iteration 7 --

Warning: bin2hex() expects parameter 1 to be binary string, array given in %s 
on line %d
NULL
-- Iteration 8 --

Warning: bin2hex() expects parameter 1 to be binary string, array given in %s 
on line %d
NULL
-- Iteration 9 --

Warning: bin2hex() expects parameter 1 to be binary string, array given in %s 
on line %d
NULL
-- Iteration 10 --
unicode(2) "31"
-- Iteration 11 --
unicode(0) ""
-- Iteration 12 --
unicode(2) "31"
-- Iteration 13 --
unicode(0) ""
-- Iteration 14 --
unicode(0) ""
-- Iteration 15 --
unicode(0) ""
-- Iteration 16 --
unicode(26) "73616d706c65206f626a656374"
-- Iteration 17 --

Warning: bin2hex() expects parameter 1 to be binary string, resource given in 
%s on line %d
NULL
-- Iteration 18 --
unicode(0) ""
-- Iteration 19 --
unicode(0) ""
===DONE===

http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/strings/count_chars_basic.phpt?view=markup&rev=1.1
Index: php-src/ext/standard/tests/strings/count_chars_basic.phpt
+++ php-src/ext/standard/tests/strings/count_chars_basic.phpt
--TEST--
Test count_chars() function : basic functionality 
--FILE--
<?php

/* Prototype  : mixed count_chars  ( string $string  [, int $mode  ] )
 * Description: Return information about characters used in a string
 * Source code: ext/standard/string.c
*/


echo "*** Testing count_chars() : basic functionality ***\n";

$string = "Return information about characters used in a string";

var_dump(count_chars($string));
var_dump(count_chars($string, 0));
var_dump(count_chars($string, 1));
var_dump(count_chars($string, 2));
var_dump(count_chars($string, 3));
var_dump(bin2hex(count_chars($string, 4)));


?>
===DONE===
--EXPECTF--
*** Testing count_chars() : basic functionality ***
array(18) {
  [u"R"]=>
  int(1)
  [u"e"]=>
  int(3)
  [u"t"]=>
  int(5)
  [u"u"]=>
  int(3)
  [u"r"]=>
  int(5)
  [u"n"]=>
  int(5)
  [u" "]=>
  int(7)
  [u"i"]=>
  int(4)
  [u"f"]=>
  int(1)
  [u"o"]=>
  int(3)
  [u"m"]=>
  int(1)
  [u"a"]=>
  int(5)
  [u"b"]=>
  int(1)
  [u"c"]=>
  int(2)
  [u"h"]=>
  int(1)
  [u"s"]=>
  int(3)
  [u"d"]=>
  int(1)
  [u"g"]=>
  int(1)
}

Warning: count_chars(): Only mode=1 is supported with Unicode strings in %s on 
line %d
bool(false)
array(18) {
  [u"R"]=>
  int(1)
  [u"e"]=>
  int(3)
  [u"t"]=>
  int(5)
  [u"u"]=>
  int(3)
  [u"r"]=>
  int(5)
  [u"n"]=>
  int(5)
  [u" "]=>
  int(7)
  [u"i"]=>
  int(4)
  [u"f"]=>
  int(1)
  [u"o"]=>
  int(3)
  [u"m"]=>
  int(1)
  [u"a"]=>
  int(5)
  [u"b"]=>
  int(1)
  [u"c"]=>
  int(2)
  [u"h"]=>
  int(1)
  [u"s"]=>
  int(3)
  [u"d"]=>
  int(1)
  [u"g"]=>
  int(1)
}

Warning: count_chars(): Only mode=1 is supported with Unicode strings in %s on 
line %d
bool(false)

Warning: count_chars(): Only mode=1 is supported with Unicode strings in %s on 
line %d
bool(false)

Warning: count_chars(): Only mode=1 is supported with Unicode strings in %s on 
line %d
unicode(0) ""
===DONE===

http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/strings/convert_uuencode_variation1.phpt?view=markup&rev=1.1
Index: php-src/ext/standard/tests/strings/convert_uuencode_variation1.phpt
+++ php-src/ext/standard/tests/strings/convert_uuencode_variation1.phpt
--TEST--
Test convert_uuencode() function : usage variations - test values for $data 
argument
--FILE--
<?php

/* Prototype  : string convert_uuencode  ( string $data  )
 * Description: Uuencode a string
 * Source code: ext/standard/uuencode.c
*/

echo "*** Testing convert_uuencode() function: with unexpected inputs for 
'data' argument ***\n";

//get an unset variable
$unset_var = 'string_val';
unset($unset_var);

//defining a class
class sample  {
  public function __toString() {
    return "sample object";
  } 
}

//getting the resource
$file_handle = fopen(__FILE__, "r");

// array with different values for $data
$inputs =  array (

                  // integer values
/*1*/     0,
                  1,
                  255,
                  256,
              2147483647,
                  -2147483648,
                
                  // float values
/*7*/     10.5,
                  -20.5,
                  10.1234567e10,
                
                  // array values
/*10*/    array(),
                  array(0),
                  array(1, 2),
                
                  // boolean values
/*13*/    true,
                  false,
                  TRUE,
                  FALSE,
                
                  // null values
/*17*/    NULL,
                  null,
                
                  // objects
/*19*/    new sample(),
                
                  // resource
/*20*/    $file_handle,
                
                  // undefined variable
/*21*/    @$undefined_var,
                
                  // unset variable
/*22*/    @$unset_var
);

// loop through with each element of the $data array to test convert_uuencode() 
function
$count = 1;
foreach($inputs as $input) {
  echo "-- Iteration $count --\n";
  var_dump( bin2hex(convert_uuencode($input)) );
  $count ++;
}

fclose($file_handle);  //closing the file handle

?>
===DONE===
--EXPECTF--
*** Testing convert_uuencode() function: with unexpected inputs for 'data' 
argument ***
-- Iteration 1 --

Warning: bin2hex() expects parameter 1 to be strictly a binary string, Unicode 
string given in %s on line %d
NULL
-- Iteration 2 --

Warning: bin2hex() expects parameter 1 to be strictly a binary string, Unicode 
string given in %s on line %d
NULL
-- Iteration 3 --

Warning: bin2hex() expects parameter 1 to be strictly a binary string, Unicode 
string given in %s on line %d
NULL
-- Iteration 4 --

Warning: bin2hex() expects parameter 1 to be strictly a binary string, Unicode 
string given in %s on line %d
NULL
-- Iteration 5 --

Warning: bin2hex() expects parameter 1 to be strictly a binary string, Unicode 
string given in %s on line %d
NULL
-- Iteration 6 --

Warning: bin2hex() expects parameter 1 to be strictly a binary string, Unicode 
string given in %s on line %d
NULL
-- Iteration 7 --

Warning: bin2hex() expects parameter 1 to be strictly a binary string, Unicode 
string given in %s on line %d
NULL
-- Iteration 8 --

Warning: bin2hex() expects parameter 1 to be strictly a binary string, Unicode 
string given in %s on line %d
NULL
-- Iteration 9 --

Warning: bin2hex() expects parameter 1 to be strictly a binary string, Unicode 
string given in %s on line %d
NULL
-- Iteration 10 --

Warning: convert_uuencode() expects parameter 1 to be string (Unicode or 
binary), array given in %s on line %d
unicode(0) ""
-- Iteration 11 --

Warning: convert_uuencode() expects parameter 1 to be string (Unicode or 
binary), array given in %s on line %d
unicode(0) ""
-- Iteration 12 --

Warning: convert_uuencode() expects parameter 1 to be string (Unicode or 
binary), array given in %s on line %d
unicode(0) ""
-- Iteration 13 --

Warning: bin2hex() expects parameter 1 to be strictly a binary string, Unicode 
string given in %s on line %d
NULL
-- Iteration 14 --
unicode(0) ""
-- Iteration 15 --

Warning: bin2hex() expects parameter 1 to be strictly a binary string, Unicode 
string given in %s on line %d
NULL
-- Iteration 16 --
unicode(0) ""
-- Iteration 17 --
unicode(0) ""
-- Iteration 18 --
unicode(0) ""
-- Iteration 19 --

Warning: bin2hex() expects parameter 1 to be strictly a binary string, Unicode 
string given in %s on line %d
NULL
-- Iteration 20 --

Warning: convert_uuencode() expects parameter 1 to be string (Unicode or 
binary), resource given in %s on line %d
unicode(0) ""
-- Iteration 21 --
unicode(0) ""
-- Iteration 22 --
unicode(0) ""
===DONE===

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to