Code Duplication    Length = 12-18 lines in 5 locations

TaskManager/tests/Spec/Kreta/TaskManager/Domain/Model/Project/Task/TaskEditedSpec.php 1 location

@@ 23-40 (lines=18) @@
20
use Kreta\TaskManager\Domain\Model\Project\Task\TaskTitle;
21
use PhpSpec\ObjectBehavior;
22
23
class TaskEditedSpec extends ObjectBehavior
24
{
25
    function let(TaskId $taskId, TaskTitle $title)
26
    {
27
        $this->beConstructedWith($taskId, $title, 'Description');
28
    }
29
30
    function it_creates_a_task_edited_event(TaskId $taskId, TaskTitle $title)
31
    {
32
        $this->shouldHaveType(TaskEdited::class);
33
        $this->shouldImplement(DomainEvent::class);
34
35
        $this->id()->shouldReturn($taskId);
36
        $this->title()->shouldReturn($title);
37
        $this->description()->shouldReturn('Description');
38
        $this->occurredOn()->shouldReturnAnInstanceOf(\DateTimeInterface::class);
39
    }
40
}
41

TaskManager/tests/Spec/Kreta/TaskManager/Domain/Model/Project/Task/TaskPriorityChangedSpec.php 1 location

@@ 23-39 (lines=17) @@
20
use Kreta\TaskManager\Domain\Model\Project\Task\TaskPriorityChanged;
21
use PhpSpec\ObjectBehavior;
22
23
class TaskPriorityChangedSpec extends ObjectBehavior
24
{
25
    function let(TaskId $taskId, TaskPriority $priority)
26
    {
27
        $this->beConstructedWith($taskId, $priority);
28
    }
29
30
    function it_creates_task_started_event(TaskId $taskId, TaskPriority $priority)
31
    {
32
        $this->shouldHaveType(TaskPriorityChanged::class);
33
        $this->shouldImplement(DomainEvent::class);
34
35
        $this->id()->shouldReturn($taskId);
36
        $this->priority()->shouldReturn($priority);
37
        $this->occurredOn()->shouldReturnAnInstanceOf(\DateTimeInterface::class);
38
    }
39
}
40

TaskManager/tests/Spec/Kreta/TaskManager/Domain/Model/Project/Task/TaskProgressChangedSpec.php 1 location

@@ 23-39 (lines=17) @@
20
use Kreta\TaskManager\Domain\Model\Project\Task\TaskProgressChanged;
21
use PhpSpec\ObjectBehavior;
22
23
class TaskProgressChangedSpec extends ObjectBehavior
24
{
25
    function let(TaskId $taskId, TaskProgress $progress)
26
    {
27
        $this->beConstructedWith($taskId, $progress);
28
    }
29
30
    function it_creates_task_started_event(TaskId $taskId, TaskProgress $progress)
31
    {
32
        $this->shouldHaveType(TaskProgressChanged::class);
33
        $this->shouldImplement(DomainEvent::class);
34
35
        $this->id()->shouldReturn($taskId);
36
        $this->progress()->shouldReturn($progress);
37
        $this->occurredOn()->shouldReturnAnInstanceOf(\DateTimeInterface::class);
38
    }
39
}
40

Notifier/tests/Spec/Kreta/Notifier/Domain/Model/Inbox/UserReadNotificationSpec.php 1 location

@@ 23-34 (lines=12) @@
20
use Kreta\SharedKernel\Domain\Model\DomainEvent;
21
use PhpSpec\ObjectBehavior;
22
23
class UserReadNotificationSpec extends ObjectBehavior
24
{
25
    function it_should_be_created(UserId $userId, NotificationId $notificationId)
26
    {
27
        $this->beConstructedWith($userId, $notificationId);
28
        $this->shouldHaveType(UserReadNotification::class);
29
        $this->shouldImplement(DomainEvent::class);
30
        $this->userId()->shouldReturn($userId);
31
        $this->notificationId()->shouldReturn($notificationId);
32
        $this->occurredOn()->shouldReturnAnInstanceOf(\DateTimeInterface::class);
33
    }
34
}
35

Notifier/tests/Spec/Kreta/Notifier/Domain/Model/Inbox/UserUnreadNotificationSpec.php 1 location

@@ 23-34 (lines=12) @@
20
use Kreta\SharedKernel\Domain\Model\DomainEvent;
21
use PhpSpec\ObjectBehavior;
22
23
class UserUnreadNotificationSpec extends ObjectBehavior
24
{
25
    function it_should_be_created(UserId $userId, NotificationId $notificationId)
26
    {
27
        $this->beConstructedWith($userId, $notificationId);
28
        $this->shouldHaveType(UserUnreadNotification::class);
29
        $this->shouldImplement(DomainEvent::class);
30
        $this->userId()->shouldReturn($userId);
31
        $this->notificationId()->shouldReturn($notificationId);
32
        $this->occurredOn()->shouldReturnAnInstanceOf(\DateTimeInterface::class);
33
    }
34
}
35