Passed
Pull Request — master (#56)
by
unknown
13:43
created

RefreshTokenAuthenticatorSpec::let()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 1 Features 0
Metric Value
c 1
b 1
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
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