TaskPrioritySpec   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
wmc 4
lcom 0
cbo 2
dl 0
loc 27
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A it_does_not_create_priority_with_invalid_priority() 0 5 1
A it_creates_a_low_priority_task_value() 0 6 1
A it_creates_a_medium_priority_task_value() 0 5 1
A it_creates_a_high_priority_task_value() 0 5 1
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
declare(strict_types=1);
14
15
namespace Spec\Kreta\TaskManager\Domain\Model\Project\Task;
16
17
use Kreta\TaskManager\Domain\Model\Project\Task\TaskPriority;
18
use Kreta\TaskManager\Domain\Model\Project\Task\TaskPriorityNotAllowedException;
19
use PhpSpec\ObjectBehavior;
20
21
class TaskPrioritySpec extends ObjectBehavior
22
{
23
    function it_does_not_create_priority_with_invalid_priority()
24
    {
25
        $this->beConstructedWith('invalid-priority');
26
        $this->shouldThrow(TaskPriorityNotAllowedException::class)->duringInstantiation();
27
    }
28
29
    function it_creates_a_low_priority_task_value()
30
    {
31
        $this->beConstructedLow();
32
        $this->priority()->shouldReturn(TaskPriority::LOW);
33
        $this->__toString()->shouldReturn(TaskPriority::LOW);
34
    }
35
36
    function it_creates_a_medium_priority_task_value()
37
    {
38
        $this->beConstructedMedium();
39
        $this->priority()->shouldReturn(TaskPriority::MEDIUM);
40
    }
41
42
    function it_creates_a_high_priority_task_value()
43
    {
44
        $this->beConstructedHigh();
45
        $this->priority()->shouldReturn(TaskPriority::HIGH);
46
    }
47
}
48