CommentTest   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A testRequiredParametersIncludedWhenConvertingToArray() 0 4 1
A testAttachmentsGetAddedWhenConvertingToArray() 0 11 1
1
<?php
2
3
namespace Manavo\DoneDone\Test;
4
5
use Manavo\DoneDone\Comment;
6
7
class CommentTest extends \PHPUnit_Framework_TestCase
8
{
9
10
    public function testRequiredParametersIncludedWhenConvertingToArray()
11
    {
12
        $this->assertArrayHasKey('comment', (new Comment())->toArray());
13
    }
14
15
    public function testAttachmentsGetAddedWhenConvertingToArray()
16
    {
17
        $comment = new Comment();
18
        $comment->setMessage('comment');
19
        $comment->addAttachment(__FILE__);
20
        $comment->addAttachment(__FILE__);
21
        $comment->addAttachment(__FILE__);
22
        $comment->addAttachment(__FILE__);
23
24
        $this->assertEquals(5, count($comment->toArray()));
25
    }
26
27
}
28