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

FileListTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 2
dl 0
loc 24
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A testAllFiles() 0 21 1
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