Test Failed
Push — master ( 0107e6...66b8c9 )
by Bence
05:42
created

RecursiveFileListingTest::testInvalidDirectory()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 2
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 2
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace CSFCloud\Tests;
4
5
use PHPUnit\Framework\TestCase;
6
use CSFCloud\RecursiveFileListing;
7
8
final class RecursiveFileListingTest extends TestCase {
9
10
    /**
11
     * @expectedException Exception
12
     */
13
    public function testInvalidDirectory() {
14
        $finder = new RecursiveFileListing(__DIR__ . "/not_existing_dir");
0 ignored issues
show
Unused Code introduced by
The assignment to $finder is dead and can be removed.
Loading history...
15
    }
16
17
    public function testFindFiles() {
18
        $finder = new RecursiveFileListing(__DIR__ . "/RecFileListTestDir");
19
        $files = $finder->scan();
20
21
        $this->assertEquals(3, count($files));
22
    }
23
24
    public function testFilterFiles() {
25
        $finder = new RecursiveFileListing(__DIR__ . "/RecFileListTestDir");
26
        $finder->addFilter('/.*\.txt$/i');
27
        $files = $finder->scan();
28
29
        $this->assertEquals(2, count($files));
30
    }
31
32
}