NodeFailTest   A
last analyzed

Complexity

Total Complexity 10

Size/Duplication

Total Lines 95
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 36
c 1
b 0
f 0
dl 0
loc 95
rs 10
wmc 10

5 Methods

Rating   Name   Duplication   Size   Complexity  
A testCreated() 0 12 2
A testFile() 0 12 2
A testDir() 0 12 2
A testExists() 0 12 2
A testSize() 0 12 2
1
<?php
2
3
namespace MapperNoRootTests;
4
5
6
use kalanis\kw_files\FilesException;
7
use kalanis\kw_mapper\MapperException;
8
use kalanis\kw_paths\PathsException;
9
10
11
class NodeFailTest extends AStorageTest
12
{
13
    /**
14
     * @throws FilesException
15
     * @throws MapperException
16
     * @throws PathsException
17
     */
18
    public function testExists(): void
19
    {
20
        if ($this->skipIt) {
21
            $this->markTestSkipped('Skipped by config');
22
            return;
23
        }
24
25
        $this->dataRefill();
26
27
        $lib = $this->getNodeFailLib();
28
        $this->expectException(FilesException::class);
29
        $lib->exists(['unknown']);
30
    }
31
32
    /**
33
     * @throws FilesException
34
     * @throws MapperException
35
     * @throws PathsException
36
     */
37
    public function testDir(): void
38
    {
39
        if ($this->skipIt) {
40
            $this->markTestSkipped('Skipped by config');
41
            return;
42
        }
43
44
        $this->dataRefill();
45
46
        $lib = $this->getNodeFailLib();
47
        $this->expectException(FilesException::class);
48
        $lib->isDir(['unknown']);
49
    }
50
51
    /**
52
     * @throws FilesException
53
     * @throws MapperException
54
     * @throws PathsException
55
     */
56
    public function testFile(): void
57
    {
58
        if ($this->skipIt) {
59
            $this->markTestSkipped('Skipped by config');
60
            return;
61
        }
62
63
        $this->dataRefill();
64
65
        $lib = $this->getNodeFailLib();
66
        $this->expectException(FilesException::class);
67
        $lib->isFile(['unknown']);
68
    }
69
70
    /**
71
     * @throws FilesException
72
     * @throws MapperException
73
     * @throws PathsException
74
     */
75
    public function testSize(): void
76
    {
77
        if ($this->skipIt) {
78
            $this->markTestSkipped('Skipped by config');
79
            return;
80
        }
81
82
        $this->dataRefill();
83
84
        $lib = $this->getNodeFailLib();
85
        $this->expectException(FilesException::class);
86
        $lib->size(['unknown']);
87
    }
88
89
    /**
90
     * @throws FilesException
91
     * @throws MapperException
92
     * @throws PathsException
93
     */
94
    public function testCreated(): void
95
    {
96
        if ($this->skipIt) {
97
            $this->markTestSkipped('Skipped by config');
98
            return;
99
        }
100
101
        $this->dataRefill();
102
103
        $lib = $this->getNodeFailLib();
104
        $this->expectException(FilesException::class);
105
        $lib->created(['unknown']);
106
    }
107
}
108