Completed
Push — master ( ceb81d...34dbeb )
by Beñat
07:47
created

UserEmailAlreadyExistsExceptionSpec   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
dl 0
loc 20
rs 10
c 0
b 0
f 0
wmc 3
lcom 0
cbo 2

3 Methods

Rating   Name   Duplication   Size   Complexity  
A let() 0 6 1
A it_is_initializable() 0 5 1
A it_should_return_message() 0 4 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
namespace Spec\Kreta\IdentityAccess\Domain\Model\User;
14
15
use BenGorUser\User\Domain\Model\UserEmail;
16
use Kreta\IdentityAccess\Domain\Model\User\UserEmailAlreadyExistsException;
17
use Kreta\SharedKernel\Domain\Model\Exception;
18
use PhpSpec\ObjectBehavior;
19
20
class UserEmailAlreadyExistsExceptionSpec extends ObjectBehavior
21
{
22
    function let()
23
    {
24
        $this->beConstructedWith(
25
            new UserEmail('[email protected]')
26
        );
27
    }
28
29
    function it_is_initializable()
30
    {
31
        $this->shouldHaveType(UserEmailAlreadyExistsException::class);
32
        $this->shouldHaveType(Exception::class);
33
    }
34
35
    function it_should_return_message()
36
    {
37
        $this->getMessage()->shouldReturn('The given "[email protected]" email is already in use by other user');
38
    }
39
}
40