File: 011.phpt

package info (click to toggle)
php-mailparse 3.1.4%2B2.1.7~dev20160128-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 2,484 kB
  • sloc: ansic: 4,080; xml: 363; php: 38; makefile: 2
file content (29 lines) | stat: -rw-r--r-- 678 bytes parent folder | download | duplicates (4)
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
--TEST--
Check mailparse_determine_best_xfer_encoding
--SKIPIF--
<?php
/* vim600: sw=4 ts=4 fdm=marker syn=php
*/
if (!extension_loaded("mailparse")) print "skip"; ?>
--FILE--
<?php
$files = new RecursiveIteratorIterator(new RecursiveDirectoryIterator(dirname(__FILE__) . "/testdata"));
$names = array();
foreach ($files as $file) {
	if (strrpos($file->getFileName(), '.txt') !== false) {
		$names[] = $file->getRealPath();
	}
}
sort($names);
foreach ($names as $name) {
	var_dump(mailparse_determine_best_xfer_encoding(fopen($name, 'r')));
}
?>
--EXPECT--
string(4) "7bit"
string(4) "7bit"
string(6) "BASE64"
string(4) "7bit"
string(4) "7bit"
string(4) "7bit"
string(4) "7bit"