Passed
Push — master ( b0febc...99b0a5 )
by Jakub
01:55
created

ChainTestSuitesFinderTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 2
eloc 10
c 1
b 0
f 1
dl 0
loc 25
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A hp$0 ➔ getSuites() 0 4 1
testGetSuites() 0 22 ?
A hp$1 ➔ testGetSuites() 0 22 1
A hp$1 ➔ getSuites() 0 4 1
1
<?php
2
declare(strict_types=1);
3
4
namespace MyTester;
5
6
use MyTester\Attributes\TestSuite;
7
8
/**
9
 * Test suite for class ChainTestSuitesFinder
10
 *
11
 * @author Jakub Konečný
12
 */
13
#[TestSuite("ChainTestSuitesFinderTest")]
14
final class ChainTestSuitesFinderTest extends TestCase
15
{
16
    public function testGetSuites(): void
17
    {
18
        $testSuitesFinder = new ChainTestSuitesFinder();
19
        $testSuitesFinder->registerFinder(new class implements ITestSuitesFinder
20
        {
21
            public function getSuites(string $folder): array
0 ignored issues
show
introduced by
The method parameter $folder is never used
Loading history...
22
            {
23
                return [
24
                    "aaa", "bbb", "ccc",
25
                ];
26
            }
27
        });
28
        $testSuitesFinder->registerFinder(new class implements ITestSuitesFinder
29
        {
30
            public function getSuites(string $folder): array
0 ignored issues
show
introduced by
The method parameter $folder is never used
Loading history...
31
            {
32
                return [
33
                    "aaa", "ddd",
34
                ];
35
            }
36
        });
37
        $this->assertSame(["aaa", "bbb", "ccc", "ddd", ], $testSuitesFinder->getSuites(""));
38
    }
39
}
40