UtilsTest   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Importance

Changes 7
Bugs 0 Features 0
Metric Value
wmc 2
eloc 8
c 7
b 0
f 0
dl 0
loc 19
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A testGetTypeName() 0 4 1
A providerGetTypeName() 0 7 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace GraphQLTests\Doctrine;
6
7
use GraphQL\Doctrine\Utils;
8
use PHPUnit\Framework\Attributes\DataProvider;
9
use PHPUnit\Framework\TestCase;
10
11
final class UtilsTest extends TestCase
12
{
13
    public static function providerGetTypeName(): array
14
    {
15
        return [
16
            ['\Blog\Model\Post', 'Post'],
17
            ['Blog\Model\Post', 'Post'],
18
            ['\Post', 'Post'],
19
            ['Post', 'Post'],
20
        ];
21
    }
22
23
    /**
24
     * @param class-string $className
25
     */
26
    #[DataProvider('providerGetTypeName')]
27
    public function testGetTypeName(string $className, string $expected): void
28
    {
29
        self::assertSame($expected, Utils::getTypeName($className));
30
    }
31
}
32