Code Duplication    Length = 15-24 lines in 4 locations

TaskManager/tests/Spec/Kreta/TaskManager/Domain/Model/Organization/OrganizationNameSpec.php 1 location

@@ 21-44 (lines=24) @@
18
use Kreta\TaskManager\Domain\Model\Organization\OrganizationNameEmptyException;
19
use PhpSpec\ObjectBehavior;
20
21
class OrganizationNameSpec extends ObjectBehavior
22
{
23
    function let()
24
    {
25
        $this->beConstructedWith('Organization name');
26
    }
27
28
    function it_is_initializable()
29
    {
30
        $this->shouldHaveType(OrganizationName::class);
31
    }
32
33
    function it_does_not_allow_empty_names()
34
    {
35
        $this->beConstructedWith('');
36
        $this->shouldThrow(OrganizationNameEmptyException::class)->duringInstantiation();
37
    }
38
39
    function it_returns_name()
40
    {
41
        $this->name()->shouldReturn('Organization name');
42
        $this->__toString()->shouldReturn('Organization name');
43
    }
44
}
45

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

@@ 21-44 (lines=24) @@
18
use Kreta\TaskManager\Domain\Model\Project\ProjectNameEmptyException;
19
use PhpSpec\ObjectBehavior;
20
21
class ProjectNameSpec extends ObjectBehavior
22
{
23
    function let()
24
    {
25
        $this->beConstructedWith('Project name');
26
    }
27
28
    function it_is_initializable()
29
    {
30
        $this->shouldHaveType(ProjectName::class);
31
    }
32
33
    function it_does_not_allow_empty_names()
34
    {
35
        $this->beConstructedWith('');
36
        $this->shouldThrow(ProjectNameEmptyException::class)->duringInstantiation();
37
    }
38
39
    function it_returns_name()
40
    {
41
        $this->name()->shouldReturn('Project name');
42
        $this->__toString()->shouldReturn('Project name');
43
    }
44
}
45

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

@@ 21-38 (lines=18) @@
18
use Kreta\TaskManager\Domain\Model\Project\Task\TaskTitleCannotBeEmptyException;
19
use PhpSpec\ObjectBehavior;
20
21
class TaskTitleSpec extends ObjectBehavior
22
{
23
    function it_creates_a_task_title()
24
    {
25
        $this->beConstructedWith('Sample title');
26
27
        $this->shouldHaveType(TaskTitle::class);
28
29
        $this->title()->shouldReturn('Sample title');
30
        $this->__toString()->shouldReturn('Sample title');
31
    }
32
33
    function it_cannot_be_created_if_title_is_empty()
34
    {
35
        $this->beConstructedWith('');
36
        $this->shouldThrow(TaskTitleCannotBeEmptyException::class)->duringInstantiation();
37
    }
38
}
39

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

@@ 20-34 (lines=15) @@
17
use Kreta\Notifier\Domain\Model\Inbox\Notification\NotificationBodyIsEmpty;
18
use PhpSpec\ObjectBehavior;
19
20
class NotificationBodySpec extends ObjectBehavior
21
{
22
    function it_does_not_create_notification_body_without_body()
23
    {
24
        $this->beConstructedWith('');
25
        $this->shouldThrow(NotificationBodyIsEmpty::class)->duringInstantiation();
26
    }
27
28
    function it_creates_a_notification_body()
29
    {
30
        $this->beConstructedWith('The notification body');
31
        $this->body()->shouldReturn('The notification body');
32
        $this->__toString()->shouldReturn('The notification body');
33
    }
34
}
35