FqcnRemoverTest::dataProvider()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 14
Code Lines 10

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 10
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 14
rs 9.9332
1
<?php
2
3
declare(strict_types=1);
4
5
namespace DaveLiddament\StaticAnalysisResultsBaseliner\Tests\Unit\Core\Utils;
6
7
use DaveLiddament\StaticAnalysisResultsBaseliner\Domain\Utils\FqcnRemover;
8
use PHPUnit\Framework\TestCase;
9
10
final class FqcnRemoverTest extends TestCase
11
{
12
    /**
13
     * @return array<string,array{string,string}>
0 ignored issues
show
Documentation Bug introduced by
The doc comment array<string,array{string,string}> at position 6 could not be parsed: Expected ':' at position 6, but found 'string'.
Loading history...
14
     */
15
    public function dataProvider(): array
16
    {
17
        return [
18
            'FQCN with method name' => [
19
                'Method DaveLiddament\StaticAnalysisBaseliner\Core\Common\Location::__construct() has parameter $fileName with no typehint specified.',
20
                'Method has parameter $fileName with no typehint specified.',
21
            ],
22
            'FQCN no method name' => [
23
                'Demo\Employee has an uninitialized variable $this->age, but no constructor',
24
                'has an uninitialized variable $this->age, but no constructor',
25
            ],
26
            'No FQCN' => [
27
                'PHPDoc tag @param has invalid value ($fileName): Unexpected token expected TOKEN_IDENTIFIER at offset 54',
28
                'PHPDoc tag @param has invalid value ($fileName): Unexpected token expected TOKEN_IDENTIFIER at offset 54',
29
            ],
30
        ];
31
    }
32
33
    /**
34
     * @dataProvider dataProvider
35
     */
36
    public function testFqcnRemover(string $input, string $expected): void
37
    {
38
        $fqcnRemove = new FqcnRemover();
39
        $actual = $fqcnRemove->removeRqcn($input);
40
        $this->assertEquals($expected, $actual);
41
    }
42
}
43