Test Setup Failed
Pull Request — master (#125)
by Tomas
20:18 queued 02:47
created

ClearInvalidRefreshTokensCommandSpec::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\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
use Symfony\Component\DependencyInjection\ContainerInterface;
12
13
class ClearInvalidRefreshTokensCommandSpec extends ObjectBehavior
14
{
15
    public function let(RefreshTokenManagerInterface $refreshTokenManager)
16
    {
17
        $this->beConstructedWith($refreshTokenManager);
18
    }
19
20
    public function it_is_initializable()
21
    {
22
        $this->shouldHaveType('Gesdinet\JWTRefreshTokenBundle\Command\ClearInvalidRefreshTokensCommand');
23
    }
24
25
    public function it_is_a_command()
26
    {
27
        $this->shouldHaveType('Symfony\Component\Console\Command\Command');
28
    }
29
30
    public function it_has_a_name()
31
    {
32
        $this->getName()->shouldReturn('gesdinet:jwt:clear');
33
    }
34
35
    public function it_clears_invalid_refresh_tokens(InputInterface $input, OutputInterface $output, RefreshTokenManagerInterface $refreshTokenManager, RefreshTokenInterface $revokedToken)
36
    {
37
        $refreshTokenManager->revokeAllInvalid(Argument::any())->shouldBeCalled()->willReturn(array($revokedToken));
38
39
        $output->writeln(Argument::any())->shouldBeCalled();
40
41
        $this->run($input, $output);
42
    }
43
}
44