summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/build_email_test.php19
1 files changed, 17 insertions, 2 deletions
diff --git a/test/build_email_test.php b/test/build_email_test.php
index d441627..ae88388 100644
--- a/test/build_email_test.php
+++ b/test/build_email_test.php
@@ -1,7 +1,5 @@
<?php
-require_once('PHPUnit/Framework.php');
-
require_once(__DIR__ . '/../src/build_email.php');
class build_email_test extends PHPUnit_Framework_TestCase {
@@ -53,6 +51,23 @@ http://www.example.com/viewtopic.php?p=42#p42",
);
}
+ /** @dataProvider build_email_subject_data */
+ public function test_build_email_subject($ftag, $re, $subject, $expected) {
+ $this->assertEquals(
+ $expected,
+ build_email_subject($ftag, $re, $subject)
+ );
+ }
+
+ public function build_email_subject_data() {
+ return array(
+ array('[f]', false, '', '[f] (no subject)'),
+ array('[f]', true, '', 'Re: [f] (no subject)'),
+ array('[f]', false, 'Subject', '[f] Subject'),
+ array('[f]', true, 'Subject', 'Re: [f] Subject'),
+ );
+ }
+
protected $default_headers = array(
'To' => 'messages@vassalengine.org',
'From' => 'Joel Uckelman <uckelman@nomic.net>',