Test Setup Failed
Push — master ( 428ef3...604b70 )
by Marcos
03:12
created

RefreshTokenAuthenticatorSpec::let()   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 1
1
<?php
2
3
namespace spec\Gesdinet\JWTRefreshTokenBundle\Security\Authenticator;
4
5
use PhpSpec\ObjectBehavior;
6
use Symfony\Component\HttpFoundation\Request;
7
use Symfony\Component\Security\Core\Authentication\Token\PreAuthenticatedToken;
8
use Symfony\Component\Security\Core\Exception\AuthenticationException;
9
use Symfony\Component\Security\Core\User\UserCheckerInterface;
10
11
class RefreshTokenAuthenticatorSpec extends ObjectBehavior
12
{
13
    public function let(UserCheckerInterface $userChecker)
14
    {
15
        $this->beConstructedWith($userChecker);
16
    }
17
18
    public function it_is_initializable()
19
    {
20
        $this->shouldHaveType('Gesdinet\JWTRefreshTokenBundle\Security\Authenticator\RefreshTokenAuthenticator');
21
    }
22
23
    public function it_supports_token(PreAuthenticatedToken $token, $providerKey)
24
    {
25
        $token->getProviderKey()->willReturn($providerKey);
26
        $this->supportsToken($token, $providerKey)->shouldBe(true);
27
    }
28
29
    public function it_fails_on_authentication(Request $request, AuthenticationException $exception)
30
    {
31
        $this->onAuthenticationFailure($request, $exception)->shouldHaveType('Symfony\Component\HttpFoundation\Response');
32
    }
33
}
34