Passed
Push — master ( 983377...eb5b2a )
by Petr
08:18
created

FileFailTest::testFreeName()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 3
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 5
rs 10
1
<?php
2
3
namespace StorageDirsTests;
4
5
6
use kalanis\kw_files\FilesException;
7
8
9
class FileFailTest extends AStorageTest
10
{
11
    /**
12
     * @throws FilesException
13
     */
14
    public function testRead(): void
15
    {
16
        $lib = $this->getFileFailLib();
17
        $this->expectException(FilesException::class);
18
        $lib->readFile(['dummy2.txt']);
19
    }
20
21
    /**
22
     * @throws FilesException
23
     */
24
    public function testSave(): void
25
    {
26
        $lib = $this->getFileFailLib();
27
        $this->expectException(FilesException::class);
28
        $lib->saveFile(['extra.txt'], 'qwertzuiopasdfghjklyxcvbnm0123456789');
29
    }
30
31
    /**
32
     * @throws FilesException
33
     */
34
    public function testCopy(): void
35
    {
36
        $lib = $this->getFileFailLib();
37
        $this->expectException(FilesException::class);
38
        $lib->copyFile(['dummy2.txt'], ['extra1.txt']);
39
    }
40
41
    /**
42
     * @throws FilesException
43
     */
44
    public function testMove(): void
45
    {
46
        $lib = $this->getFileFailLib();
47
        $this->expectException(FilesException::class);
48
        $lib->moveFile(['extra1.txt'], ['extra2.txt']);
49
    }
50
51
    /**
52
     * @throws FilesException
53
     */
54
    public function testDelete(): void
55
    {
56
        $lib = $this->getFileFailLib();
57
        $this->expectException(FilesException::class);
58
        $lib->deleteFile(['extra2.txt']);
59
    }
60
}
61