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.

FileCacheTest::testDeleteNonExistentObject()   A
last analyzed

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 0
1
<?php
2
3
namespace JDesrosiers\Resourceful\FileCache\Test;
4
5
use JDesrosiers\Resourceful\FileCache\FileCache;
6
use Symfony\Component\Filesystem\Filesystem;
7
8
class FileCacheTest extends \PHPUnit_Framework_TestCase
9
{
10
    private $service;
11
    private $testDir;
12
13
    public function setUp()
14
    {
15
        $this->testDir = __DIR__ . "/test";
16
17
        $this->cleanUp();
18
        $this->service = new FileCache($this->testDir);
19
    }
20
21
    public function tearDown()
22
    {
23
        $this->cleanUp();
24
    }
25
26
    private function cleanUp()
27
    {
28
        $filesystem = new Filesystem();
29
        if ($filesystem->exists($this->testDir)) {
30
            $filesystem->remove($this->testDir);
31
        }
32
    }
33
34
    public function testStoreNewObject()
35
    {
36
        $this->service->save("foo", "bar");
37
38
        $this->assertEquals("bar", $this->service->fetch("foo"));
39
    }
40
41
    public function testReplaceObject()
42
    {
43
        $this->service->save("foo", "foo");
44
        $this->service->save("foo", "bar");
45
46
        $this->assertEquals("bar", $this->service->fetch("foo"));
47
    }
48
49
    public function testRetrieveNonexistentObject()
50
    {
51
        $this->assertFalse($this->service->fetch("foo"));
52
    }
53
54
    public function testDeleteObject()
55
    {
56
        $this->service->save("foo", "bar");
57
        $this->service->delete("foo");
58
59
        $this->assertFalse($this->service->fetch("foo"));
60
    }
61
62
    public function testDeleteNonExistentObject()
63
    {
64
        $this->service->delete("foo");
65
    }
66
67
    public function testGetStats()
68
    {
69
        $this->assertNull($this->service->getStats());
70
    }
71
}
72