Completed
Push — master ( df502b...4c9fbf )
by Rémi
17s
created

TeamWorkerPatchMessageSpec::it_should_build()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 12
Code Lines 7

Duplication

Lines 12
Ratio 100 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 12
loc 12
rs 9.4285
cc 1
eloc 7
nc 1
nop 0
1
<?php
2
3
namespace spec\Yproximite\Api\Message\TeamWorker;
4
5
use PhpSpec\ObjectBehavior;
6
7
use Yproximite\Api\Model\TeamWorker\TeamWorker;
8
use Yproximite\Api\Message\TeamWorker\TeamWorkerPatchMessage;
9
10 View Code Duplication
class TeamWorkerPatchMessageSpec extends ObjectBehavior
0 ignored issues
show
Duplication introduced by
This class 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...
11
{
12
    function it_is_initializable()
13
    {
14
        $this->shouldHaveType(TeamWorkerPatchMessage::class);
15
    }
16
17
    function it_should_build()
18
    {
19
        $this->setLastName('Bob');
20
        $this->setFirstName('Morane');
21
22
        $data = [
23
            'lastName'  => 'Bob',
24
            'firstName' => 'Morane',
25
        ];
26
27
        $this->build()->shouldReturn($data);
28
    }
29
30
    function it_should_create_from_team_worker(TeamWorker $teamWorker)
31
    {
32
        $teamWorker->getId()->willReturn(1);
33
        $teamWorker->getLastName()->willReturn('Bob');
34
        $teamWorker->getFirstName()->willReturn('Morane');
35
36
        $message = new TeamWorkerPatchMessage();
37
        $message->setId(1);
38
        $message->setLastName('Bob');
39
        $message->setFirstName('Morane');
40
41
        $this::createFromTeamWorker($teamWorker)->shouldBeLike($message);
42
    }
43
}
44