UtilsTest::providerGetTypeName()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 5
c 1
b 0
f 0
dl 0
loc 7
rs 10
cc 1
nc 1
nop 0
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