diff options
author | Anika Henke <anika@selfthinker.org> | 2013-08-04 10:41:00 +0100 |
---|---|---|
committer | Anika Henke <anika@selfthinker.org> | 2013-08-04 10:41:00 +0100 |
commit | 71c1143e8785954ea00a62aeb755ca7d8fa47e56 (patch) | |
tree | c813b1fe3590314fcb1f20a30811d5de92871583 /_test/tests/inc/mailer.test.php | |
parent | d637819dca760b20f6e53e5847a92d08d8d15b8c (diff) | |
parent | 90d5fa676926189b265430239dca3b7ba668b30b (diff) | |
download | rpg-71c1143e8785954ea00a62aeb755ca7d8fa47e56.tar.gz rpg-71c1143e8785954ea00a62aeb755ca7d8fa47e56.tar.bz2 |
Merge remote-tracking branch 'origin/master' into video-audio
Diffstat (limited to '_test/tests/inc/mailer.test.php')
-rw-r--r-- | _test/tests/inc/mailer.test.php | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/_test/tests/inc/mailer.test.php b/_test/tests/inc/mailer.test.php index 053e216b8..ef78692b3 100644 --- a/_test/tests/inc/mailer.test.php +++ b/_test/tests/inc/mailer.test.php @@ -15,6 +15,11 @@ class TestMailer extends Mailer { public function prepareHeaders() { return parent::prepareHeaders(); } + + public function cleanHeaders() { + parent::cleanHeaders(); + } + } class mailer_test extends DokuWikiTest { @@ -67,6 +72,47 @@ class mailer_test extends DokuWikiTest { $this->assertArrayNotHasKey('Test-Header',$headers); } + function test_addresses(){ + $mail = new TestMailer(); + + $mail->to('andi@splitbrain.org'); + $mail->cleanHeaders(); + $headers = $mail->prop('headers'); + $this->assertEquals('andi@splitbrain.org', $headers['To']); + + $mail->to('<andi@splitbrain.org>'); + $mail->cleanHeaders(); + $headers = $mail->prop('headers'); + $this->assertEquals('andi@splitbrain.org', $headers['To']); + + $mail->to('Andreas Gohr <andi@splitbrain.org>'); + $mail->cleanHeaders(); + $headers = $mail->prop('headers'); + $this->assertEquals('Andreas Gohr <andi@splitbrain.org>', $headers['To']); + + $mail->to('Andreas Gohr <andi@splitbrain.org> , foo <foo@example.com>'); + $mail->cleanHeaders(); + $headers = $mail->prop('headers'); + $this->assertEquals('Andreas Gohr <andi@splitbrain.org>, foo <foo@example.com>', $headers['To']); + + $mail->to('Möp <moep@example.com> , foo <foo@example.com>'); + $mail->cleanHeaders(); + $headers = $mail->prop('headers'); + $this->assertEquals('=?UTF-8?B?TcO2cA==?= <moep@example.com>, foo <foo@example.com>', $headers['To']); + + $mail->to(array('Möp <moep@example.com> ',' foo <foo@example.com>')); + $mail->cleanHeaders(); + $headers = $mail->prop('headers'); + $this->assertEquals('=?UTF-8?B?TcO2cA==?= <moep@example.com>, foo <foo@example.com>', $headers['To']); + + $mail->to(array('Beet, L van <lvb@example.com>',' foo <foo@example.com>')); + $mail->cleanHeaders(); + $headers = $mail->prop('headers'); + $this->assertEquals('=?UTF-8?B?QmVldCwgTCB2YW4=?= <lvb@example.com>, foo <foo@example.com>', $headers['To']); + + + } + function test_simplemail(){ global $conf; $conf['htmlmail'] = 0; |