Completed
Push — master ( 659231...788af6 )
by Wanderson
05:06
created

EmailTest   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
c 1
b 0
f 0
lcom 0
cbo 2
dl 0
loc 24
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A testSetSubject() 0 5 1
A testSetBodyInStringMode() 0 5 1
A testSetBodyInBlockMode() 0 8 1
1
<?php
2
3
namespace Win\Mailer;
4
5
use Win\Mailer\Email;
6
use Win\Mvc\Block;
7
8
class EmailTest extends \PHPUnit_Framework_TestCase {
9
10
	public function testSetSubject() {
11
		$email = new Email();
12
		$email->setSubject('My Subject');
13
		$this->assertEquals('My Subject', $email->getSubject());
14
	}
15
16
	public function testSetBodyInStringMode() {
17
		$email = new Email();
18
		$email->setBody('My body in string mode');
19
		$this->assertEquals('My body in string mode', $email->getBody());
20
	}
21
22
	public function testSetBodyInBlockMode() {
23
		$email = new Email();
24
		$body = new Block('this-block-doent-exist');
25
		$email->setBody($body);
26
27
		$this->assertTrue($email->getBody() instanceof Block);
28
		$this->assertEquals('', $email->getBody());
29
	}
30
31
}
32