1<?php 2/** 3 * General tests for the smtp plugin 4 * 5 * @group plugin_smtp 6 * @group plugins 7 */ 8class message_plugin_smtp_test extends DokuWikiTest { 9 public function setUp() { 10 parent::setUp(); 11 require_once __DIR__ . '/../loader.php'; 12 } 13 14 public function test_body() { 15 $input = trim(' 16X-Mailer: DokuWiki 17X-Dokuwiki-User: admin 18X-Dokuwiki-Title: Test Wiki 19X-Dokuwiki-Server: localhost.localhost 20From: a@example.com 21To: b@example.com 22Bcc: c@example.com, d@example.com, 23 d@example.com 24Subject: A test 25 26This is the body of the mail 27Bcc: this is not a header line 28end of message 29'); 30 31 $expect = trim(' 32X-Mailer: DokuWiki 33X-Dokuwiki-User: admin 34X-Dokuwiki-Title: Test Wiki 35X-Dokuwiki-Server: localhost.localhost 36From: a@example.com 37To: b@example.com 38Subject: A test 39 40This is the body of the mail 41Bcc: this is not a header line 42end of message 43'); 44 $expect .= "\r\n\r\n.\r\n"; 45 46 $message = new \splitbrain\dokuwiki\plugin\smtp\Message('','',$input); 47 48 $this->assertEquals($expect, $message->toString()); 49 50 } 51} 52