Completed
Push — master ( 3b3980...4ce207 )
by Gorka
9s
created

UsernameSpec::it_does_not_allow_empty_username()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 5
Ratio 100 %

Importance

Changes 0
Metric Value
dl 5
loc 5
c 0
b 0
f 0
rs 9.4285
cc 1
eloc 3
nc 1
nop 0
1
<?php
2
3
namespace Spec\Kreta\SharedKernel\Domain\Model\Identity;
4
5
use Kreta\SharedKernel\Domain\Model\Identity\Username;
6
use Kreta\SharedKernel\Domain\Model\Identity\UsernameInvalidException;
7
use PhpSpec\ObjectBehavior;
8
9 View Code Duplication
class UsernameSpec 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...
10
{
11
    function let()
12
    {
13
        $this->beConstructedWith('kretausername');
14
    }
15
16
    function it_is_initializable()
17
    {
18
        $this->shouldHaveType(Username::class);
19
    }
20
21
    function it_does_not_allow_empty_username()
22
    {
23
        $this->beConstructedWith('');
24
        $this->shouldThrow(UsernameInvalidException::class)->duringInstantiation();
25
    }
26
27
    function it_returns_username()
28
    {
29
        $this->username()->shouldReturn('kretausername');
30
        $this->__toString()->shouldReturn('kretausername');
31
    }
32
}
33