Busybox: Upgrade to 1.21.1 (stable). lsof active.
[tomato.git] / release / src / router / php / ext / imap / tests / imap_base64_basic.phpt
bloba64be276d901e0836b478b621ba7673be46d17f3
1 --TEST--
2 Test imap_base64() function : basic functionality 
3 --SKIPIF--
4 <?php
5 extension_loaded('imap') or die('skip imap extension not available in this build');
6 ?>
7 --FILE--
8 <?php
9 /* Prototype  : string imap_base64  ( string $text  )
10  * Description: Decode BASE64 encoded text.
11  * Source code: ext/imap/php_imap.c
12  */
14 echo "*** Testing imap_base64() : basic functionality ***\n";
16 $str = b'This is an example string to be base 64 encoded';
17 $base64 = base64_encode($str);
18 if (imap_base64($base64) == $str) {
19         echo "TEST PASSED\n";
20 } else {
21         echo "TEST FAILED";
24 $str = b'!£$%^&*()_+-={][];;@~#?/>.<,';
25 $base64 = base64_encode($str);
26 if (imap_base64($base64) == $str) {
27         echo "TEST PASSED\n";
28 } else {
29         echo "TEST FAILED";
32 $hex = b'x00\x01\x02\x03\x04\x05\x06\xFA\xFB\xFC\xFD\xFE\xFF';
33 $base64 = base64_encode($hex);
34 if (imap_base64($base64) == $hex) {
35         echo "TEST PASSED\n";
36 } else {
37         echo "TEST FAILED";
38 }               
41 ===Done===
42 --EXPECT--
43 *** Testing imap_base64() : basic functionality ***
44 TEST PASSED
45 TEST PASSED
46 TEST PASSED
47 ===Done===