Completed
Push — master ( 87026b...b29a51 )
by Łukasz
06:23 queued 03:44
created

CandidatesFinderSpec   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A it_should_find_candidates_in_numerical_order() 0 12 2
1
<?php
2
3
namespace spec\Tworzenieweb\SqlProvisioner\Filesystem;
4
5
use Symfony\Component\Finder\SplFileInfo;
6
use Tworzenieweb\SqlProvisioner\Filesystem\CandidatesFinder;
7
use PhpSpec\ObjectBehavior;
8
use Prophecy\Argument;
9
10
/**
11
 * Class CandidatesFinderSpec
12
 * @package spec\Tworzenieweb\SqlProvisioner\Filesystem
13
 * @mixin CandidatesFinder
14
 */
15
class CandidatesFinderSpec extends ObjectBehavior
16
{
17
    function it_should_find_candidates_in_numerical_order()
18
    {
19
        $results = $this->find(__DIR__ . DIRECTORY_SEPARATOR . 'fixture/finder');
20
        $results->count()->shouldReturn(2);
21
        $filenames = [];
22
23
        foreach ($results->getWrappedObject() as $file) {
24
            array_push($filenames, $file->getFilename());
25
        }
26
27
        expect($filenames)->shouldEqual(['001_test.sql', '002_test.sql']);
28
    }
29
}
30