UtilsTest   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Importance

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

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
    /**
14
     * @param class-string $className
15
     */
16
    #[DataProvider('providerGetTypeName')]
17
    public function testGetTypeName(string $className, string $expected): void
18
    {
19
        self::assertSame($expected, Utils::getTypeName($className));
20
    }
21
22
    public static function providerGetTypeName(): iterable
23
    {
24
        return [
25
            ['\Blog\Model\Post', 'Post'],
26
            ['Blog\Model\Post', 'Post'],
27
            ['\Post', 'Post'],
28
            ['Post', 'Post'],
29
        ];
30
    }
31
}
32