Completed
Pull Request — master (#366)
by Beñat
04:55
created

UserSpec   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 1
dl 0
loc 16
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A it_can_be_built() 0 7 1
A it_can_be_built_from_array() 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\Notifier\Domain\ReadModel\Inbox;
16
17
use Kreta\Notifier\Domain\ReadModel\Inbox\User;
18
use PhpSpec\ObjectBehavior;
19
20
class UserSpec extends ObjectBehavior
21
{
22
    function it_can_be_built()
23
    {
24
        $this->beConstructedWith('user-id');
25
        $this->shouldHaveType(User::class);
26
        $this->shouldImplement(\JsonSerializable::class);
27
        $this->jsonSerialize()->shouldReturn(['id' => 'user-id']);
28
    }
29
30
    function it_can_be_built_from_array()
31
    {
32
        $this->beConstructedFromArray(['id' => 'user-id']);
33
        $this->jsonSerialize()->shouldReturn(['id' => 'user-id']);
34
    }
35
}
36