~ubuntu-branches/ubuntu/trusty/php-mail-mime/trusty

« back to all changes in this revision

Viewing changes to Mail_Mime-1.8.2/tests/test_Bug_14779.phpt

  • Committer: Package Import Robot
  • Author(s): Thomas Goirand
  • Date: 2012-01-18 19:26:59 UTC
  • mfrom: (2.1.6 sid)
  • Revision ID: package-import@ubuntu.com-20120118192659-hrcynaknl79awjyg
Tags: 1.8.2-1
* New upstream version (Closes: #656265).
* Now using the PKG PEAR team as maintainer.
* Bumped Standards-Version to 3.9.2 (no change needed).
* Switching to pkg-php-tools and dh 8 auto-sequencer (so, rewrote
debian/rules).
* Now using DEP5 format for debian/copyright.
* Now using source format 3.0 (quilt).
* Fixed Vcs fields.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
--TEST--
 
2
Bug #14779  Proper header-body separator for empty attachment
 
3
--SKIPIF--
 
4
--FILE--
 
5
<?php
 
6
error_reporting(E_ALL); // ignore E_STRICT
 
7
include "Mail/mime.php";
 
8
 
 
9
$m = new Mail_mime();
 
10
$m->addAttachment('', "text/plain", 'file.txt', FALSE, 'base64', 'attachment');
 
11
$result = $m->get();
 
12
 
 
13
if (preg_match('/(Content.*)--=.*/s', $result, $matches)) {
 
14
    print_r($matches[1]."END");
 
15
}
 
16
 
 
17
?>
 
18
--EXPECT--
 
19
Content-Transfer-Encoding: base64
 
20
Content-Type: text/plain;
 
21
 name=file.txt
 
22
Content-Disposition: attachment;
 
23
 filename=file.txt
 
24
 
 
25
 
 
26
END
 
 
b'\\ No newline at end of file'