Completed
Push — master ( ea9d41...184c59 )
by Sergii
08:21
created

TaskCollectionTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Importance

Changes 0
Metric Value
wmc 1
lcom 1
cbo 3
dl 0
loc 26
c 0
b 0
f 0
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A testAdd() 0 23 1
1
<?php
2
namespace Tests\AppBundle\Sync\Entity;
3
4
use AppBundle\Sync\Entity\Task;
5
use AppBundle\Sync\Entity\TaskCollection;
6
7
/**
8
 * Task Collection tests
9
 *
10
 * @author Sergey Sadovoi <[email protected]>
11
 */
12
class TaskCollectionTest extends \PHPUnit_Framework_TestCase
13
{
14
    public function testAdd()
15
    {
16
        /**
17
         * @var Task $task
18
         */
19
        $task = $this->getMockBuilder(Task::class)
20
            ->getMock();
21
22
        // Create collection
23
        $collection = new TaskCollection();
24
        $this->assertCount(0, $collection);
25
26
        // Add task
27
        $collection->addTask($task);
28
        $this->assertCount(1, $collection);
29
30
        // Check task
31
        $this->assertEquals($task, $collection->get(0));
32
33
        // Add task one more time
34
        $collection->addTask($task);
35
        $this->assertCount(2, $collection);
36
    }
37
}
38