summaryrefslogtreecommitdiff
path: root/ext/standard/tests/strings/convert_uuencode_basic.phpt
blob: 94a9e808f21f77e2450a51f9536daf3b18cd9c1b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
--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 --
string(8) "#,3(S
`
"
-- Iteration 2 --
string(8) "#86)C
`
"
-- Iteration 3 --
string(12) "&,6$R8C-C
`
"
-- Iteration 4 --
string(82) "M2&5R92!I<R!A('-I;7!L92!S=')I;F<@=&\@=&5S="!C;VYV97)T7W5U96YC
*;V1E+V1E8V]D90``
`
"
-- Iteration 5 --
string(74) "M"2!4:&ES(%-T<FEN9R!C;VYT86EN<R`)"2!S;VUE(&-O;G1R;VP@8VAA<F%C
&=&5R<PT*
`
"
-- Iteration 6 --
string(28) "2D)$`DY20D966EYB9FIN<G9Z?
`
"
-- Iteration 7 --
string(8) "#,3(S
`
"
-- Iteration 8 --
string(8) "#86)C
`
"
-- Iteration 9 --
string(12) "&,6$R8C-C
`
"
-- Iteration 10 --
string(82) "M7'0@5&AI<R!3=')I;F<@8V]N=&%I;G,@7'1<="!S;VUE(&-O;G1R;VP@8VAA
+<F%C=&5R<UQR7&X`
`
"
===DONE===