File: imap_8bit_basic.phpt

package info (click to toggle)
php5 5.6.33%2Bdfsg-0%2Bdeb8u1
  • links: PTS, VCS
  • area: main
  • in suites: jessie
  • size: 157,872 kB
  • sloc: ansic: 756,065; php: 22,030; sh: 12,311; cpp: 8,771; xml: 6,179; yacc: 1,564; exp: 1,514; makefile: 1,467; pascal: 1,147; awk: 538; perl: 315; sql: 22
file content (33 lines) | stat: -rw-r--r-- 1,059 bytes parent folder | download | duplicates (7)
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
--TEST--
Test imap_8bit() function : basic functionality 
--SKIPIF--
<?php
extension_loaded('imap') or die('skip imap extension not available in this build');
?>
--FILE--
<?php
/* Prototype  : string imap_8bit  ( string $string  )
 * Description: Convert an 8bit string to a quoted-printable string.
 * Source code: ext/imap/php_imap.c
 */

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

var_dump(imap_8bit("String with CRLF at end \r\n"));
//NB this appears to be a bug in cclient; a space at end of string should be encoded as =20
var_dump(imap_8bit("String with space at end "));
var_dump(imap_8bit("String with tabs \t\t in middle"));
var_dump(imap_8bit("String with tab at end \t"));
var_dump(imap_8bit("\x00\x01\x02\x03\x04\xfe\xff\x0a\x0d"));

?>
===Done===
--EXPECT--
*** Testing imap_8bit() : basic functionality ***
string(28) "String with CRLF at end=20
"
string(25) "String with space at end "
string(33) "String with tabs =09=09 in middle"
string(26) "String with tab at end =09"
string(27) "=00=01=02=03=04=FE=FF=0A=0D"
===Done===