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

AlertTest::testGetMessage()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 3
nc 1
nop 0
1
<?php
2
3
namespace Win\Alert;
4
5
use Win\Alert\AlertError;
6
7
class AlertTest extends \PHPUnit_Framework_TestCase {
8
9
	public function testGetMessage() {
10
		$instance = new AlertError('My Alert');
11
		$this->assertEquals('My Alert', $instance->message);
12
	}
13
14
	public function testGetType() {
15
		$instance = new AlertError('My Error msg');
16
		$this->assertEquals('danger', $instance->type);
17
18
		$instance2 = new AlertSuccess('My Success msg');
19
		$this->assertEquals('success', $instance2->type);
20
	}
21
22
	public function testAddAlertOnSession() {
23
		Session::showAlerts();
24
		new AlertError('My Alert 01');
25
		new AlertError('My Alert 02');
26
		$this->assertEquals(2, count(Session::getAlerts()));
27
28
		Session::showAlerts();
29
		$this->assertEquals(0, count(Session::getAlerts()));
30
	}
31
32
}
33