Completed
Pull Request — master (#168)
by Beñat
11:53 queued 06:57
created

it_creates_a_todo_task_progress_value()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 6
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 4
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\Domain\Model\Project\Task;
14
15
use Kreta\TaskManager\Domain\Model\Project\Task\TaskProgress;
16
use Kreta\TaskManager\Domain\Model\Project\Task\TaskProgressNotAllowedException;
17
use PhpSpec\ObjectBehavior;
18
19
class TaskProgressSpec extends ObjectBehavior
20
{
21
    function it_does_not_create_progress_with_invalid_progress()
22
    {
23
        $this->beConstructedWith('invalid-progress');
24
        $this->shouldThrow(TaskProgressNotAllowedException::class)->duringInstantiation();
25
    }
26
27
    function it_creates_a_todo_task_progress_value()
28
    {
29
        $this->beConstructedTodo();
30
        $this->progress()->shouldReturn(TaskProgress::TODO);
31
        $this->__toString()->shouldReturn(TaskProgress::TODO);
32
    }
33
34
    function it_creates_a_doing_task_progress_value()
35
    {
36
        $this->beConstructedDoing();
37
        $this->progress()->shouldReturn(TaskProgress::DOING);
38
        $this->__toString()->shouldReturn(TaskProgress::DOING);
39
    }
40
41
    function it_creates_a_done_task_progress_value()
42
    {
43
        $this->beConstructedDone();
44
        $this->progress()->shouldReturn(TaskProgress::DONE);
45
        $this->__toString()->shouldReturn(TaskProgress::DONE);
46
    }
47
}
48