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

BaseTestSuitesFinderTest.php$0 ➔ testIsTestSuite()   A

Complexity

Conditions 1

Size

Total Lines 17

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 17
rs 9.7
cc 1

2 Methods

Rating   Name   Duplication   Size   Complexity  
A BaseTestSuitesFinderTest.php$0 ➔ isTestSuite() 0 3 1
A BaseTestSuitesFinderTest.php$0 ➔ getSuites() 0 3 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 BaseTestSuitesFinder
10
 *
11
 * @author Jakub Konečný
12
 */
13
#[TestSuite("BaseTestSuitesFinderTest")]
14
final class BaseTestSuitesFinderTest extends TestCase
15
{
16
    public function testIsTestSuite(): void
17
    {
18
        $testSuitesFinder = new class extends BaseTestSuitesFinder
19
        {
20
            public function getSuites(string $folder): array
0 ignored issues
show
introduced by
The method parameter $folder is never used
Loading history...
21
            {
22
                return [];
23
            }
24
25
            public function isTestSuite(string $class): bool
0 ignored issues
show
introduced by
Possible useless method overriding detected
Loading history...
26
            {
27
                return parent::isTestSuite($class);
28
            }
29
        };
30
        $this->assertFalse($testSuitesFinder->isTestSuite("abcdefg"));
31
        $this->assertFalse($testSuitesFinder->isTestSuite(TestSuite::class));
32
        $this->assertTrue($testSuitesFinder->isTestSuite(static::class));
33
    }
34
}
35