testAttachmentsGetAddedWhenConvertingToArray()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 11
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 3
Bugs 0 Features 0
Metric Value
cc 1
eloc 8
c 3
b 0
f 0
nc 1
nop 0
dl 0
loc 11
rs 9.4285
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