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

FindOnMultipleCriteriaTest::algorithms()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 7
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
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