FullNameSpec::it_creates_with_empty_last_name()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 6

Duplication

Lines 8
Ratio 100 %

Importance

Changes 0
Metric Value
cc 1
eloc 6
nc 1
nop 0
dl 8
loc 8
rs 9.4285
c 0
b 0
f 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
declare(strict_types=1);
14
15
namespace Spec\Kreta\IdentityAccess\Domain\Model\User;
16
17
use Kreta\IdentityAccess\Domain\Model\User\FirstNameEmptyException;
18
use PhpSpec\ObjectBehavior;
19
20
class FullNameSpec extends ObjectBehavior
21
{
22
    function it_does_not_create_full_name_with_empty_first_name()
23
    {
24
        $this->beConstructedWith('', '');
25
        $this->shouldThrow(FirstNameEmptyException::class)->duringInstantiation();
26
    }
27
28 View Code Duplication
    function it_creates_with_empty_last_name()
0 ignored issues
show
Duplication introduced by
This method 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...
29
    {
30
        $this->beConstructedWith('Kreta', '');
31
        $this->firstName()->shouldReturn('Kreta');
32
        $this->lastName()->shouldReturn('');
33
        $this->fullName()->shouldReturn('Kreta');
34
        $this->__toString()->shouldReturn('Kreta');
35
    }
36
37 View Code Duplication
    function it_creates()
0 ignored issues
show
Duplication introduced by
This method 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...
38
    {
39
        $this->beConstructedWIth('Kreta', 'Info');
40
        $this->firstName()->shouldReturn('Kreta');
41
        $this->lastName()->shouldReturn('Info');
42
        $this->fullName()->shouldReturn('Kreta Info');
43
        $this->__toString()->shouldReturn('Kreta Info');
44
    }
45
}
46