Test Setup Failed
Push — master ( a6eeeb...ed6f5d )
by Marcos
02:52
created

ClearInvalidRefreshTokensCommandSpec   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 4

Importance

Changes 0
Metric Value
wmc 5
lcom 0
cbo 4
dl 0
loc 31
rs 10
c 0
b 0
f 0

5 Methods

Rating   Name   Duplication   Size   Complexity  
A let() 0 4 1
A it_is_initializable() 0 4 1
A it_is_a_command() 0 4 1
A it_has_a_name() 0 4 1
A it_clears_invalid_refresh_tokens() 0 8 1
1
<?php
2
3
namespace spec\Gesdinet\JWTRefreshTokenBundle\Command;
4
5
use Gesdinet\JWTRefreshTokenBundle\Model\RefreshTokenInterface;
6
use Gesdinet\JWTRefreshTokenBundle\Model\RefreshTokenManagerInterface;
7
use PhpSpec\ObjectBehavior;
8
use Prophecy\Argument;
9
use Symfony\Component\Console\Input\InputInterface;
10
use Symfony\Component\Console\Output\OutputInterface;
11
12
class ClearInvalidRefreshTokensCommandSpec extends ObjectBehavior
13
{
14
    public function let(RefreshTokenManagerInterface $refreshTokenManager)
15
    {
16
        $this->beConstructedWith($refreshTokenManager);
17
    }
18
19
    public function it_is_initializable()
20
    {
21
        $this->shouldHaveType('Gesdinet\JWTRefreshTokenBundle\Command\ClearInvalidRefreshTokensCommand');
22
    }
23
24
    public function it_is_a_command()
25
    {
26
        $this->shouldHaveType('Symfony\Component\Console\Command\Command');
27
    }
28
29
    public function it_has_a_name()
30
    {
31
        $this->getName()->shouldReturn('gesdinet:jwt:clear');
32
    }
33
34
    public function it_clears_invalid_refresh_tokens(InputInterface $input, OutputInterface $output, RefreshTokenManagerInterface $refreshTokenManager, RefreshTokenInterface $revokedToken)
35
    {
36
        $refreshTokenManager->revokeAllInvalid(Argument::any())->shouldBeCalled()->willReturn(array($revokedToken));
37
38
        $output->writeln(Argument::any())->shouldBeCalled();
39
40
        $this->run($input, $output);
41
    }
42
}
43