Passed
Push — master ( cb2d88...e8a992 )
by Petr
08:25
created

XProcessNode::isWritable()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
cc 1
eloc 1
nc 1
nop 1
dl 0
loc 3
rs 10
c 1
b 0
f 1
1
<?php
2
3
namespace TraitsTests;
4
5
6
use CommonTestClass;
7
use kalanis\kw_files\FilesException;
8
use kalanis\kw_files\Interfaces\IProcessNodes;
9
use kalanis\kw_files\Traits\TNode;
10
11
12
class NodeTest extends CommonTestClass
13
{
14
    /**
15
     * @throws FilesException
16
     */
17
    public function testPass(): void
18
    {
19
        $lib = new XNode();
20
        $lib->setProcessNode(new XProcessNode());
21
        $this->assertNotEmpty($lib->getProcessNode());
22
    }
23
24
    /**
25
     * @throws FilesException
26
     */
27
    public function testFail(): void
28
    {
29
        $lib = new XNode();
30
        $this->expectException(FilesException::class);
31
        $lib->getProcessNode();
32
    }
33
}
34
35
36
class XNode
37
{
38
    use TNode;
39
}
40
41
42
class XProcessNode implements IProcessNodes
43
{
44
    public function exists(array $entry): bool
45
    {
46
        return false;
47
    }
48
49
    public function isReadable(array $entry): bool
50
    {
51
        return false;
52
    }
53
54
    public function isWritable(array $entry): bool
55
    {
56
        return false;
57
    }
58
59
    public function isDir(array $entry): bool
60
    {
61
        return false;
62
    }
63
64
    public function isFile(array $entry): bool
65
    {
66
        return false;
67
    }
68
69
    public function size(array $entry): ?int
70
    {
71
        return null;
72
    }
73
74
    public function created(array $entry): ?int
75
    {
76
        return null;
77
    }
78
}
79