File tree Expand file tree Collapse file tree 1 file changed +17
-1
lines changed
Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Original file line number Diff line number Diff line change 44// php run_tests.php
55
66
7- // added a clearer barrier
7+ // added a clear barrier between messages
88function printBarrier ()
99{
1010 echo "\r\n" ;
1111 echo "=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= " ;
1212 echo "\r\n" ;
1313}
14+ // add in-message barrier
15+ function printInMessageBarrier ()
16+ {
17+ echo "\r\n" ;
18+ echo "- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - " ;
19+ echo "\r\n" ;
20+ }
1421function printnl ($ message )
1522{
1623 echo "$ message \r\n" ;
1724}
1825
26+ // include the PlancakeEmailParser class
1927require_once (dirname (__DIR__ ) . DIRECTORY_SEPARATOR . "PlancakeEmailParser.php " );
2028
29+ // fetch all sample emails
2130$ emails = glob (__DIR__ . DIRECTORY_SEPARATOR . "emails " . DIRECTORY_SEPARATOR . "* " );
2231
32+ // start output with a barrier
2333printBarrier ();
2434
35+ // after correction, getHTMLBody doesnt include barrier in output
2536foreach ($ emails as $ email ) {
2637 printnl ("Email $ email " );
2738 $ emailParser = new PlancakeEmailParser (file_get_contents ($ email ));
2839 printnl ("subject: " . $ emailParser ->getSubject ());
40+ printInMessageBarrier ();
2941 printnl ("body: " . $ emailParser ->getBody ());
42+ printInMessageBarrier ();
43+ printnl ("plain body: " . $ emailParser ->getPlainBody ());
44+ printInMessageBarrier ();
45+ printnl ("html body: " . $ emailParser ->getHTMLBody ());
3046 printBarrier ();
3147}
You can’t perform that action at this time.
0 commit comments