Completed
Pull Request — master (#15)
by
unknown
05:30
created

FindOnMultipleCriteriaTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A testFindingFilesOnMultipleCriteria() 0 9 1
A algorithms() 0 7 1
1
<?php
2
/**
3
 * This file is part of phpDocumentor.
4
 *
5
 * For the full copyright and license information, please view the LICENSE
6
 * file that was distributed with this source code.
7
 *
8
 * @copyright 2010-2018 Mike van Riel<[email protected]>
9
 * @license   http://www.opensource.org/licenses/mit-license.php MIT
10
 * @link      http://phpdoc.org
11
 */
12
13
namespace Flyfinder;
14
15
use PHPUnit\Framework\TestCase;
16
17
/**
18
 * Integration test against examples/02-find-on-multiple-criteria.php
19
 * @coversNothing
20
 */
21
class FindOnMultipleCriteriaTest extends TestCase
22
{
23
    use TestsBothAlgorithms;
24
    /**
25
     * @param int $finderAlgorithm
26
     * @dataProvider algorithms
27
     */
28
    public function testFindingFilesOnMultipleCriteria(int $finderAlgorithm)
29
    {
30
        $result = [];
31
        include(__DIR__ . '/../../examples/02-find-on-multiple-criteria.php');
32
33
        $this->assertCount(2, $result);
34
        $this->assertSame('found.txt', $result[0]['basename']);
35
        $this->assertSame('example.txt', $result[1]['basename']);
36
    }
37
38
    public function algorithms() : array
39
    {
40
        return [
41
            'legacy algorithm' => [Finder::ALGORITHM_LEGACY],
42
            'optimized algorithm' => [Finder::ALGORITHM_OPTIMIZED]
43
        ];
44
    }
45
}
46