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 ( af400a...61ccff )
by Hilari
02:07
created

ArrayCacheSpec   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 36
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 36
wmc 4
lcom 0
cbo 2
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A it_is_initializable() 0 5 1
A it_can_store_items() 0 6 1
A it_throws_an_exception_when_trying_to_get_a_non_set_item() 0 4 1
A it_can_return_a_default_value_when_pulling_a_non_set_item() 0 4 1
1
<?php
2
3
namespace spec\Cmp\Cache\Infrastructure\Backend;
4
5
use Cmp\Cache\Domain\Exceptions\ExpiredException;
6
use Cmp\Cache\Domain\Exceptions\NotFoundException;
7
use PhpSpec\ObjectBehavior;
8
9
/**
10
 * Class ArrayCacheSpec
11
 *
12
 * @package spec\Cmp\Cache\Infrastructure\Backend
13
 * @mixin \Cmp\Cache\Infrastructure\Backend\ArrayCache
14
 */
15
class ArrayCacheSpec extends ObjectBehavior
16
{
17
    function it_is_initializable()
18
    {
19
        $this->shouldHaveType('Cmp\Cache\Infrastructure\Backend\ArrayCache');
20
        $this->shouldHaveType('Cmp\Cache\Domain\Cache');
21
    }
22
    
23
    function it_can_store_items()
24
    {
25
        $this->has('foo')->shouldReturn(false);
26
        $this->set('foo', 'bar');
27
        $this->has('foo')->shouldReturn(true);
28
    }
29
30
    /*
0 ignored issues
show
Unused Code Comprehensibility introduced by
68% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
31
    function it_can_store_items_for_a_limited_period_of_time()
32
    {
33
        $this->has('foo')->shouldReturn(false);
34
        $this->set('foo', 'bar', 1);
35
36
        sleep(2);
37
        $this->shouldThrow(new ExpiredException('foo'))->duringGet('foo');
38
    }
39
    */
40
41
    function it_throws_an_exception_when_trying_to_get_a_non_set_item()
42
    {
43
        $this->shouldThrow(new NotFoundException('foo'))->duringGet('foo');
44
    }
45
46
    function it_can_return_a_default_value_when_pulling_a_non_set_item()
47
    {
48
        $this->pull('foo', 'bar')->shouldReturn('bar');
49
    }
50
}
51