summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authoruckelman <uckelman@nomic.net>2010-11-02 21:53:54 +0000
committeruckelman <uckelman@nomic.net>2010-11-02 21:53:54 +0000
commit61c02026379a4d54b8df5227b5d70bdad7ddb41e (patch)
tree66a9a66121a6b0248b68055cd17a7c0da22b86b9 /test
parent4d93d328a5d4bc812e2dde77fb8832c73d0065c8 (diff)
Filled out remaining tests. Added test for broken multipart/alternative handling.
git-svn-id: https://vassalengine.svn.sourceforge.net/svnroot/vassalengine/site-src/trunk@7439 67b53d14-2c14-4ace-a08f-0dab2b34000c
Diffstat (limited to 'test')
-rw-r--r--test/MailmanMessageTest.php57
1 files changed, 52 insertions, 5 deletions
diff --git a/test/MailmanMessageTest.php b/test/MailmanMessageTest.php
index cb3ccd2..fcd62af 100644
--- a/test/MailmanMessageTest.php
+++ b/test/MailmanMessageTest.php
@@ -35,7 +35,51 @@ class MailmanMessageTest extends PHPUnit_Framework_TestCase {
'message_id' => '<20100302094228.33F0310091@charybdis.ellipsis.cx>',
'in_reply_to' => '<1267473003.m2f.17543@www.vassalengine.org>',
'references' => '<1267171317.m2f.17507@www.vassalengine.org> <1267473003.m2f.17543@www.vassalengine.org>',
- 'body' => ''
+ 'flattened' => array(
+ file_get_contents(__DIR__ . '/1_flat'),
+ array()
+ )
+ )),
+ array(array(
+ 'data' => file_get_contents(__DIR__ . '/377'),
+ 'source' => 'messages@vassalengine.org',
+ 'post_id' => '',
+ 'from' => 'mkiefte@dal.ca',
+ 'subject' => 'Re: [messages] [Module Design] Cropping and using Transparency',
+ 'message_id' => '<AANLkTi=BzoLFm5L5DwdxHwNr9tkRpHz+3O8Z6akU85HZ@mail.gmail.com>',
+ 'in_reply_to' => '<1286462494.20188.1569.bridge@www.vassalengine.org>',
+ 'references' => '<1286462494.20188.1569.bridge@www.vassalengine.org>',
+ 'flattened' => array(
+ file_get_contents(__DIR__ . '/377_flat'),
+ array()
+ )
+ )),
+ array(array(
+ 'data' => file_get_contents(__DIR__ . '/287'),
+ 'source' => 'messages@vassalengine.org',
+ 'post_id' => '',
+ 'from' => 'pgeerkens@hotmail.com',
+ 'subject' => '[messages] Edit: [Developers] Re: Wannabe VASSAL developer has setup question',
+ 'message_id' => '<1285379813.20024.1394.bridge@www.vassalengine.org>',
+ 'in_reply_to' => '<1285379627.20024.1393.bridge@www.vassalengine.org>',
+ 'references' => null,
+ 'flattened' => array(
+ file_get_contents(__DIR__ . '/287_flat'),
+ array(
+ array(
+ 'filename' => 'Eclispse2.PNG',
+ 'mimetype' => 'image/png',
+ 'comment' => '',
+ 'data' => file_get_contents(__DIR__ . '/Eclispse2.PNG')
+ ),
+ array(
+ 'filename' => 'Eclipse.PNG',
+ 'mimetype' => 'image/png',
+ 'comment' => '',
+ 'data' => file_get_contents(__DIR__ . '/Eclipse.PNG')
+ )
+ )
+ )
))
);
}
@@ -48,14 +92,16 @@ class MailmanMessageTest extends PHPUnit_Framework_TestCase {
* @dataProvider provider
*/
public function testGetSource($expected) {
- $this->markTestIncomplete();
+ $msg = $this->buildMessage($expected);
+ $this->assertEquals($expected['source'], $msg->getSource());
}
/**
* @dataProvider provider
*/
public function testGetPostId($expected) {
- $this->markTestIncomplete();
+ $msg = $this->buildMessage($expected);
+ $this->assertEquals($expected['post_id'], $msg->getPostId());
}
/**
@@ -101,8 +147,9 @@ class MailmanMessageTest extends PHPUnit_Framework_TestCase {
/**
* @dataProvider provider
*/
- public function testGetBody($expected) {
- $this->markTestIncomplete();
+ public function testGetFlattenedParts($expected) {
+ $msg = $this->buildMessage($expected);
+ $this->assertEquals($expected['flattened'], $msg->getFlattenedParts());
}
}