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

RevokeRefreshTokenCommandSpec::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
12
class RevokeRefreshTokenCommandSpec 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\RevokeRefreshTokenCommand');
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:revoke');
32
    }
33
34
    public function it_revokes_a_refresh_token(InputInterface $input, OutputInterface $output, RefreshTokenManagerInterface $refreshTokenManager, RefreshTokenInterface $refreshToken)
35
    {
36
        $refreshTokenManager->get(Argument::any())->shouldBeCalled()->willReturn($refreshToken);
37
38
        $refreshTokenManager->delete($refreshToken)->shouldBeCalled();
39
        $output->writeln(Argument::any())->shouldBeCalled();
40
41
        $this->run($input, $output);
42
    }
43
44
    public function it_not_revokes_a_refresh_token(InputInterface $input, OutputInterface $output, RefreshTokenManagerInterface $refreshTokenManager, RefreshTokenInterface $refreshToken)
0 ignored issues
show
Unused Code introduced by
The parameter $refreshToken is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
45
    {
46
        $refreshTokenManager->get(Argument::any())->shouldBeCalled()->willReturn(null);
47
48
        $this->run($input, $output)->shouldBe(-1);
49
    }
50
}
51