RefreshTokenSpec::it_has_a_custom_refresh_token()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5

Duplication

Lines 5
Ratio 100 %

Importance

Changes 0
Metric Value
dl 5
loc 5
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
namespace spec\Gesdinet\JWTRefreshTokenBundle\Entity;
4
5
use PhpSpec\ObjectBehavior;
6
7 View Code Duplication
class RefreshTokenSpec extends ObjectBehavior
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
8
{
9
    public function let()
10
    {
11
        $this->setUsername('test');
12
        $this->setRefreshToken();
13
    }
14
15
    public function it_is_initializable()
16
    {
17
        $this->shouldHaveType('Gesdinet\JWTRefreshTokenBundle\Document\RefreshToken');
18
    }
19
20
    public function it_has_a_custom_refresh_token()
21
    {
22
        $this->setRefreshToken('token');
23
        $this->getRefreshToken()->shouldBe('token');
24
    }
25
26
    public function it_has_username()
27
    {
28
        $this->getUsername()->shouldBe('test');
29
    }
30
31
    public function it_has_valid()
32
    {
33
        $date = new \DateTime();
34
        $this->setValid($date);
35
36
        $this->getValid()->shouldBe($date);
37
    }
38
39
    public function it_is_valid()
40
    {
41
        $date = new \DateTime();
42
        $date->modify('+1 day');
43
        $this->setValid($date);
44
45
        $this->isValid()->shouldBe(true);
46
    }
47
48
    public function it_is_not_valid()
49
    {
50
        $date = new \DateTime();
51
        $date->modify('-1 day');
52
        $this->setValid($date);
53
54
        $this->isValid()->shouldBe(false);
55
    }
56
}
57