Completed
Push — master ( d048e0...15889a )
by Christian
02:23
created

FileListTest::testAllFiles()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 21
Code Lines 16

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 21
rs 9.3142
c 0
b 0
f 0
cc 1
eloc 16
nc 1
nop 0
1
<?php
2
3
namespace uuf6429\ElderBrother\Action;
4
5
use uuf6429\ElderBrother\Change;
6
7
class FileListTest extends \PHPUnit_Framework_TestCase
8
{
9
    public function testAllFiles()
10
    {
11
        $source = function () {
12
            return [
13
                'src/Acme/',
14
                'src/Acme/Combinator.php',
15
                'src/Acme/Comparator.php',
16
                'src/Acme/config.yml',
17
                'test/Acme/data.dml',
18
                'test/Acme/AllTests.phpt',
19
                'README',
20
                'LICENSE',
21
            ];
22
        };
23
        $fileList = new Change\FileList('', $source);
24
25
        $this->assertCount(8, $fileList->toArray());
26
        $this->assertCount(2, $fileList->endingWith('.php')->toArray());
27
        $this->assertCount(4, $fileList->startingWith('src/')->toArray());
28
        $this->assertCount(6, $fileList->name('/Acme/')->toArray());
29
    }
30
}
31