|
1
|
|
|
<?php |
|
2
|
|
|
namespace SebastianFeldmann\Ftp; |
|
3
|
|
|
|
|
4
|
|
|
use PHPUnit\Framework\TestCase; |
|
|
|
|
|
|
5
|
|
|
|
|
6
|
|
|
class FileTest extends TestCase |
|
7
|
|
|
{ |
|
8
|
|
|
/** |
|
9
|
|
|
* Tests File::__construct |
|
10
|
|
|
* |
|
11
|
|
|
* @expectedException \Exception |
|
12
|
|
|
*/ |
|
13
|
|
|
public function testConstructNoType() |
|
14
|
|
|
{ |
|
15
|
|
|
$file = new File([]); |
|
|
|
|
|
|
16
|
|
|
} |
|
17
|
|
|
|
|
18
|
|
|
/** |
|
19
|
|
|
* Tests File::__construct |
|
20
|
|
|
* |
|
21
|
|
|
* @expectedException \Exception |
|
22
|
|
|
*/ |
|
23
|
|
|
public function testConstructNoName() |
|
24
|
|
|
{ |
|
25
|
|
|
$file = new File(['type' => 'file']); |
|
|
|
|
|
|
26
|
|
|
} |
|
27
|
|
|
|
|
28
|
|
|
/** |
|
29
|
|
|
* Tests File::__construct |
|
30
|
|
|
*/ |
|
31
|
|
|
public function testConstructNoMtime() |
|
32
|
|
|
{ |
|
33
|
|
|
$file = new File(['type' => 'file', 'name' => 'foo.txt', 'size' => 100]); |
|
34
|
|
|
$date = $file->getLastModifyDate(); |
|
35
|
|
|
|
|
36
|
|
|
$this->assertTrue(is_a($date, \DateTimeImmutable::class)); |
|
37
|
|
|
} |
|
38
|
|
|
|
|
39
|
|
|
/** |
|
40
|
|
|
* Tests File::getUniqueName |
|
41
|
|
|
*/ |
|
42
|
|
|
public function testGetUnique() |
|
43
|
|
|
{ |
|
44
|
|
|
$file = new File(['type' => 'file', 'name' => 'foo.txt', 'size' => 100, 'unique' => 'UN']); |
|
45
|
|
|
$this->assertEquals('UN', $file->getUniqueName()); |
|
46
|
|
|
} |
|
47
|
|
|
|
|
48
|
|
|
/** |
|
49
|
|
|
* Tests File::isDir |
|
50
|
|
|
*/ |
|
51
|
|
|
public function testIsDir() |
|
52
|
|
|
{ |
|
53
|
|
|
$file = new File(['type' => 'file', 'name' => 'foo.txt', 'size' => 100, 'unique' => 'UN']); |
|
54
|
|
|
$this->assertFalse($file->isDir()); |
|
55
|
|
|
$this->assertTrue($file->isFile()); |
|
56
|
|
|
} |
|
57
|
|
|
|
|
58
|
|
|
/** |
|
59
|
|
|
* Tests File::isDir |
|
60
|
|
|
*/ |
|
61
|
|
|
public function testIsFile() |
|
62
|
|
|
{ |
|
63
|
|
|
$file = new File(['type' => 'dir', 'name' => 'foo.txt', 'size' => 100, 'unique' => 'UN']); |
|
64
|
|
|
$this->assertTrue($file->isDir()); |
|
65
|
|
|
$this->assertFalse($file->isFile()); |
|
66
|
|
|
} |
|
67
|
|
|
} |
|
68
|
|
|
|
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths