1--TEST-- 2Test convert_uudecode() function : basic functionality 3--FILE-- 4<?php 5 6/* Prototype : string convert_uudecode ( string $data ) 7 * Description: Decode a uuencoded string 8 * Source code: ext/standard/uuencode.c 9*/ 10 11echo "*** Testing convert_uudecode() : basic functionality ***\n"; 12 13// array with different values for $string 14$strings = array ( 15 16 //double quoted strings 17 "123", 18 "abc", 19 "1a2b3c", 20 "Here is a simple string to test convert_uuencode/decode", 21 "\t This String contains \t\t some control characters\r\n", 22 "\x90\x91\x00\x93\x94\x90\x91\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f", 23 24 //single quoted strings 25 '123', 26 'abc', 27 '1a2b3c', 28 '\t This String contains \t\t some control characters\r\n', 29 30); 31 32// loop through with each element of the $strings array to test convert_uudecode() function 33$count = 1; 34foreach($strings as $string) { 35 36 $encode = convert_uuencode($string); 37 $decode = convert_uudecode($encode); 38 39 if ($decode != $string) { 40 var_dump($encode, $decode, $string); 41 exit("TEST FAILED on iteration $count\n"); 42 } 43 44 $count ++; 45} 46 47echo "TEST PASSED\n"; 48 49?> 50===DONE=== 51--EXPECT-- 52*** Testing convert_uudecode() : basic functionality *** 53TEST PASSED 54===DONE=== 55