Completed
Push — master ( 107213...44f4dd )
by Damian
04:37 queued 01:50
created

CFlashMessagesTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A testNewMessage() 0 7 1
A testShowMsg() 0 7 1
1
<?php
2
namespace dambuk\CFlashMessages;
3
/**
4
 * HTML Form elements.
5
 *
6
 */
7
class CFlashMessagesTest extends \PHPUnit_Framework_TestCase
8
{
9
public function testNewMessage() {
10
$el = new \dambuk\CFlashMessages\CFlashMessages();
11
        $el->addMessage('content', 'type');
12
        $res = $el->getFlashMessages();
13
        $exp = "<div class='type'><p>content</p></div>";
14
        $this->assertEquals($res, $exp, "Missmatch");
15
}
16
public function testShowMsg() {
17
 
18
$el = new \dambuk\CFlashMessages\CFlashMessages();
19
        $res = $el->getFlashMessages();
20
        $exp = null;
21
        $this->assertEquals($res, $exp, "Missmatch");
22
}
23
}
24
?>
0 ignored issues
show
Best Practice introduced by
It is not recommended to use PHP's closing tag ?> in files other than templates.

Using a closing tag in PHP files that only contain PHP code is not recommended as you might accidentally add whitespace after the closing tag which would then be output by PHP. This can cause severe problems, for example headers cannot be sent anymore.

A simple precaution is to leave off the closing tag as it is not required, and it also has no negative effects whatsoever.

Loading history...