UtilsTest::providerGetTypeName()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
dl 0
loc 7
rs 10
c 2
b 0
f 0
eloc 5
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
    /**
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