summaryrefslogtreecommitdiff
path: root/test/EmailMessageTest.php
diff options
context:
space:
mode:
authoruckelman <uckelman@nomic.net>2010-03-20 13:46:11 +0000
committeruckelman <uckelman@nomic.net>2010-03-20 13:46:11 +0000
commit8cba263bbcc182839695c068abf145195a07bffc (patch)
tree7e86138e2e351c7a094ea7322076ea4b6baef977 /test/EmailMessageTest.php
parent13a0097cc17f93ef3ee2a984e807bdead5c6987e (diff)
Completed tests for most EmailMessage methods.
git-svn-id: https://vassalengine.svn.sourceforge.net/svnroot/vassalengine/site-src/trunk@6619 67b53d14-2c14-4ace-a08f-0dab2b34000c
Diffstat (limited to 'test/EmailMessageTest.php')
-rw-r--r--test/EmailMessageTest.php82
1 files changed, 64 insertions, 18 deletions
diff --git a/test/EmailMessageTest.php b/test/EmailMessageTest.php
index f544477..ffbd666 100644
--- a/test/EmailMessageTest.php
+++ b/test/EmailMessageTest.php
@@ -2,40 +2,86 @@
require_once('PHPUnit/Framework.php');
+require_once('src/EmailMessage.php');
+
class EmailMessageTest extends PHPUnit_Framework_TestCase {
-
- /** @test */
- public function testGetSource() {
+
+ public function provider() {
+ return array(
+ array(array(
+ 'file' => __DIR__ . '/1',
+ 'source' => '',
+ 'post_id' => '',
+ 'from' => 'uckelman@nomic.net',
+ 'subject' => 'Re: [Developers]Re: Adding developers?',
+ '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' => ''
+ ))
+ );
}
- /** @test */
- public function testGetPostId() {
+ /**
+ * @dataProvider provider
+ */
+ public function testGetSource($expected) {
+ $this->markTestIncomplete();
}
- /** @test */
- public function testGetFrom() {
+ /**
+ * @dataProvider provider
+ */
+ public function testGetPostId($expected) {
+ $this->markTestIncomplete();
}
- /** @test */
- public function testGetSubject() {
+ /**
+ * @dataProvider provider
+ */
+ public function testGetFrom($expected) {
+ $msg = new EmailMessage(file_get_contents($expected['file']));
+ $this->assertEquals($expected['from'], $msg->getFrom());
+ }
+
+ /**
+ * @dataProvider provider
+ */
+ public function testGetSubject($expected) {
+ $msg = new EmailMessage(file_get_contents($expected['file']));
+ $this->assertEquals($expected['subject'], $msg->getSubject());
}
- /** @test */
- public function testGetMessageId() {
+ /**
+ * @dataProvider provider
+ */
+ public function testGetMessageId($expected) {
+ $msg = new EmailMessage(file_get_contents($expected['file']));
+ $this->assertEquals($expected['message_id'], $msg->getMessageId());
}
- /** @test */
- public function testGetInReplyTo() {
+ /**
+ * @dataProvider provider
+ */
+ public function testGetInReplyTo($expected) {
+ $msg = new EmailMessage(file_get_contents($expected['file']));
+ $this->assertEquals($expected['in_reply_to'], $msg->getInReplyTo());
}
- /** @test */
- public function testGetReferences() {
+ /**
+ * @dataProvider provider
+ */
+ public function testGetReferences($expected) {
+ $msg = new EmailMessage(file_get_contents($expected['file']));
+ $this->assertEquals($expected['references'], $msg->getReferences());
}
- /** @test */
- public function testGetBody() {
+ /**
+ * @dataProvider provider
+ */
+ public function testGetBody($expected) {
+ $this->markTestIncomplete();
}
-
}
?>