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

XProcessDir   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
eloc 6
dl 0
loc 25
rs 10
c 1
b 0
f 1
wmc 5

5 Methods

Rating   Name   Duplication   Size   Complexity  
A createDir() 0 3 1
A deleteDir() 0 3 1
A copyDir() 0 3 1
A moveDir() 0 3 1
A readDir() 0 3 1
1
<?php
2
3
namespace TraitsTests;
4
5
6
use CommonTestClass;
7
use kalanis\kw_files\FilesException;
8
use kalanis\kw_files\Interfaces\IProcessDirs;
9
use kalanis\kw_files\Traits\TDir;
10
11
12
class DirTest extends CommonTestClass
13
{
14
    /**
15
     * @throws FilesException
16
     */
17
    public function testPass(): void
18
    {
19
        $lib = new XDir();
20
        $lib->setProcessDir(new XProcessDir());
21
        $this->assertNotEmpty($lib->getProcessDir());
22
    }
23
24
    /**
25
     * @throws FilesException
26
     */
27
    public function testFail(): void
28
    {
29
        $lib = new XDir();
30
        $this->expectException(FilesException::class);
31
        $lib->getProcessDir();
32
    }
33
}
34
35
36
class XDir
37
{
38
    use TDir;
39
}
40
41
42
class XProcessDir implements IProcessDirs
43
{
44
    public function createDir(array $entry, bool $deep = false): bool
45
    {
46
        return true;
47
    }
48
49
    public function readDir(array $entry, bool $loadRecursive = false, bool $wantSize = false): array
50
    {
51
        return [];
52
    }
53
54
    public function copyDir(array $source, array $dest): bool
55
    {
56
        return true;
57
    }
58
59
    public function moveDir(array $source, array $dest): bool
60
    {
61
        return true;
62
    }
63
64
    public function deleteDir(array $entry, bool $deep = false): bool
65
    {
66
        return true;
67
    }
68
}
69