Completed
Pull Request — master (#1638)
by Thomas
06:26
created

ReplyMessageTest   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 36
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Importance

Changes 1
Bugs 1 Features 0
Metric Value
wmc 4
c 1
b 1
f 0
lcom 1
cbo 3
dl 0
loc 36
rs 10
1
<?php
2
3
/**
4
 * @author Christoph Wurst <[email protected]>
5
 *
6
 * Mail
7
 *
8
 * This code is free software: you can redistribute it and/or modify
9
 * it under the terms of the GNU Affero General Public License, version 3,
10
 * as published by the Free Software Foundation.
11
 *
12
 * This program is distributed in the hope that it will be useful,
13
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
 * GNU Affero General Public License for more details.
16
 *
17
 * You should have received a copy of the GNU Affero General Public License, version 3,
18
 * along with this program.  If not, see <http://www.gnu.org/licenses/>
19
 *
20
 */
21
namespace OCA\Mail\Tests\Model;
22
23
use OCA\Mail\Model\ReplyMessage;
24
25
class ReplyMessageTest extends MessageTest {
26
27
	protected function setUp() {
28
		parent::setUp();
29
30
		$this->message = new ReplyMessage();
31
	}
32
33
	public function testSubject() {
34
		$subject = 'test message';
35
36
		$this->message->setSubject($subject);
37
38
		// "Re: " should be added
39
		$this->assertSame("Re: $subject", $this->message->getSubject());
40
	}
41
42
	public function testSubjectReStacking() {
43
		$subject = 'Re: test message';
44
45
		$this->message->setSubject($subject);
46
47
		// Subject shouldn't change
48
		$this->assertSame($subject, $this->message->getSubject());
49
	}
50
51
	public function testSubjectReCaseStacking() {
52
		$subject = 'RE: test message';
53
54
		$this->message->setSubject($subject);
55
56
		// Subject shouldn't change
57
		$this->assertSame($subject, $this->message->getSubject());
58
	}
59
60
}
61