Completed
Push — 1.4-password-hashing ( c4872d )
by Kamil
11:17
created

UserWithEncoderFactorySpec::it_is_a_factory()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace spec\Sylius\Bundle\UserBundle\Factory;
6
7
use PhpSpec\ObjectBehavior;
8
use Sylius\Component\Resource\Factory\FactoryInterface;
9
use Sylius\Component\User\Model\UserInterface;
10
11
final class UserWithEncoderFactorySpec extends ObjectBehavior
12
{
13
    function let(FactoryInterface $decoratedUserFactory)
14
    {
15
        $this->beConstructedWith($decoratedUserFactory, 'encodername');
16
    }
17
18
    function it_is_a_factory(): void
19
    {
20
        $this->shouldHaveType(FactoryInterface::class);
21
    }
22
23
    function it_sets_the_given_encoder_name_on_created_user(FactoryInterface $decoratedUserFactory, UserInterface $user): void
24
    {
25
        $decoratedUserFactory->createNew()->willReturn($user);
26
27
        $user->setEncoderName('encodername')->shouldBeCalled();
28
29
        $this->createNew()->shouldReturn($user);
30
    }
31
}
32