Completed
Pull Request — master (#143)
by Beñat
03:47 queued 46s
created

it_can_be_created_with_basic_info()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 19
Code Lines 16

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 19
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 16
nc 1
nop 0
1
<?php
2
3
/*
4
 * This file is part of the Kreta package.
5
 *
6
 * (c) Beñat Espiña <[email protected]>
7
 * (c) Gorka Laucirica <[email protected]>
8
 *
9
 * For the full copyright and license information, please view the LICENSE
10
 * file that was distributed with this source code.
11
 */
12
13
namespace Spec\Kreta\TaskManager\Application\Project\Task;
14
15
use Kreta\TaskManager\Application\Project\Task\CreateTaskCommand;
16
use PhpSpec\ObjectBehavior;
17
18
class CreateTaskCommandSpec extends ObjectBehavior
19
{
20
    function it_can_be_created_with_basic_info()
21
    {
22
        $this->beConstructedWith(
23
            'title',
24
            'description',
25
            'creator-id',
26
            'assignee-id',
27
            'priority',
28
            'project-id'
29
        );
30
        $this->shouldHaveType(CreateTaskCommand::class);
31
        $this->title()->shouldReturn('title');
32
        $this->description()->shouldReturn('description');
33
        $this->creatorId()->shouldReturn('creator-id');
34
        $this->assigneeId()->shouldReturn('assignee-id');
35
        $this->projectId()->shouldReturn('project-id');
36
        $this->parentId()->shouldReturn(null);
37
        $this->taskId()->shouldReturn(null);
38
    }
39
40 View Code Duplication
    function it_can_be_created_with_basic_info_and_parent()
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
41
    {
42
        $this->beConstructedWith(
43
            'title',
44
            'description',
45
            'creator-id',
46
            'assignee-id',
47
            'priority',
48
            'project-id',
49
            'parent-id'
50
        );
51
        $this->title()->shouldReturn('title');
52
        $this->description()->shouldReturn('description');
53
        $this->creatorId()->shouldReturn('creator-id');
54
        $this->assigneeId()->shouldReturn('assignee-id');
55
        $this->projectId()->shouldReturn('project-id');
56
        $this->parentId()->shouldReturn('parent-id');
57
        $this->taskId()->shouldReturn(null);
58
    }
59
60 View Code Duplication
    function it_can_be_created_with_basic_info_and_parent_and_id()
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
61
    {
62
        $this->beConstructedWith(
63
            'title',
64
            'description',
65
            'creator-id',
66
            'assignee-id',
67
            'priority',
68
            'project-id',
69
            'parent-id',
70
            'task-id'
71
        );
72
        $this->title()->shouldReturn('title');
73
        $this->description()->shouldReturn('description');
74
        $this->creatorId()->shouldReturn('creator-id');
75
        $this->assigneeId()->shouldReturn('assignee-id');
76
        $this->projectId()->shouldReturn('project-id');
77
        $this->parentId()->shouldReturn('parent-id');
78
        $this->taskId()->shouldReturn('task-id');
79
    }
80
}
81