Test Setup Failed
Pull Request — master (#125)
by Tomas
20:18 queued 02:47
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
use Symfony\Component\DependencyInjection\ContainerInterface;
12
13
class RevokeRefreshTokenCommandSpec 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\RevokeRefreshTokenCommand');
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:revoke');
33
    }
34
35
    public function it_revokes_a_refresh_token(InputInterface $input, OutputInterface $output, RefreshTokenManagerInterface $refreshTokenManager, RefreshTokenInterface $refreshToken)
36
    {
37
        $refreshTokenManager->get(Argument::any())->shouldBeCalled()->willReturn($refreshToken);
38
39
        $refreshTokenManager->delete($refreshToken)->shouldBeCalled();
40
        $output->writeln(Argument::any())->shouldBeCalled();
41
42
        $this->run($input, $output);
43
    }
44
45
    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...
46
    {
47
        $refreshTokenManager->get(Argument::any())->shouldBeCalled()->willReturn(null);
48
49
        $this->run($input, $output)->shouldBe(-1);
50
    }
51
}
52