GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Push — master ( ba7cd4...25ae2a )
by Hilari
04:31
created

RedisCacheSpec::it_can_empty_the_cache()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 6
rs 9.4285
cc 1
eloc 3
nc 1
nop 1
1
<?php
2
3
namespace spec\Cmp\Cache\Infrastructure;
4
5
use Cmp\Cache\Domain\Exceptions\NotFoundException;
6
use PhpSpec\ObjectBehavior;
7
use Redis;
8
9
/**
10
 * Class RedisCacheSpec
11
 *
12
 * @package spec\Cmp\Cache\Infrastructure
13
 * @mixin \Cmp\Cache\Infrastructure\RedisCache
14
 */
15
class RedisCacheSpec extends ObjectBehavior
16
{
17
    function let(Redis $redis)
18
    {
19
        $this->beConstructedWith($redis);
20
    }
21
22
    function it_is_initializable()
23
    {
24
        $this->shouldHaveType('Cmp\Cache\Infrastructure\RedisCache');
25
        $this->shouldHaveType('Cmp\Cache\Domain\Cache');
26
    }
27
28
    function it_can_store_items(Redis $redis)
29
    {
30
        $this->set('foo', 'bar');
31
32
        $redis->set('foo', 'bar')->shouldHaveBeenCalled();
33
    }
34
35
    function it_can_store_items_for_a_limited_period_of_time(Redis $redis)
36
    {
37
        $this->set('foo', 'bar', 1);
38
39
        $redis->setex('foo', 1, 'bar')->shouldHaveBeenCalled();
40
    }
41
42
    function it_can_check_the_existence_of_an_item_in_the_cache(Redis $redis)
43
    {
44
        $redis->exists('foo')->willReturn(true);
45
46
        $this->has('foo')->shouldReturn(true);
47
    }
48
49
    function it_throws_an_exception_when_trying_to_get_a_non_set_item(Redis $redis)
50
    {
51
        $redis->get('foo')->willReturn(null);
52
        $redis->exists('foo')->willReturn(false);
53
54
        $this->shouldThrow(new NotFoundException('foo'))->duringGet('foo');
55
    }
56
57
    function it_can_return_a_default_value_when_pulling_a_non_set_item(Redis $redis)
58
    {
59
        $redis->get('foo')->willReturn(null);
60
        $redis->exists('foo')->willReturn(false);
61
62
        $this->pull('foo', 'bar')->shouldReturn('bar');
63
    }
64
65
    function it_can_empty_the_cache(Redis $redis)
66
    {
67
        $this->flush();
68
69
        $redis->flushDB()->shouldHaveBeenCalled();
70
    }
71
}
72