Passed
Push — master ( 95ec1e...702df7 )
by Petr
02:32
created

DirRecursiveFailTest   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 55
Duplicated Lines 0 %

Importance

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

5 Methods

Rating   Name   Duplication   Size   Complexity  
A testRead() 0 5 1
A testCopy() 0 5 1
A testCreate() 0 5 1
A testMove() 0 5 1
A testDelete() 0 5 1
1
<?php
2
3
namespace StorageDirsTests;
4
5
6
use kalanis\kw_files\FilesException;
7
use kalanis\kw_paths\PathsException;
8
9
10
class DirRecursiveFailTest extends AStorageTest
11
{
12
    /**
13
     * @throws FilesException
14
     * @throws PathsException
15
     */
16
    public function testCreate(): void
17
    {
18
        $lib = $this->getDirRecursiveFailLib();
19
        $this->expectException(FilesException::class);
20
        $lib->createDir(['another'], false);
21
    }
22
23
    /**
24
     * @throws FilesException
25
     * @throws PathsException
26
     */
27
    public function testRead(): void
28
    {
29
        $lib = $this->getDirRecursiveFailLib();
30
        $this->expectException(FilesException::class);
31
        $lib->readDir([''], false, true);
32
    }
33
34
    /**
35
     * @throws FilesException
36
     * @throws PathsException
37
     */
38
    public function testCopy(): void
39
    {
40
        $lib = $this->getDirRecursiveFailLib();
41
        $this->expectException(FilesException::class);
42
        $lib->copyDir(['next_one'], ['more']);
43
    }
44
45
    /**
46
     * @throws FilesException
47
     * @throws PathsException
48
     */
49
    public function testMove(): void
50
    {
51
        $lib = $this->getDirRecursiveFailLib();
52
        $this->expectException(FilesException::class);
53
        $lib->moveDir(['more'], ['another']);
54
    }
55
56
    /**
57
     * @throws FilesException
58
     * @throws PathsException
59
     */
60
    public function testDelete(): void
61
    {
62
        $lib = $this->getDirRecursiveFailLib();
63
        $this->expectException(FilesException::class);
64
        $lib->deleteDir(['another'], true);
65
    }
66
}
67