Failed Conditions
Push — master ( 0ef5da...6c8847 )
by Adrien
11:04 queued 07:56
created

PhpEnumTypeTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 10
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
eloc 6
c 1
b 0
f 0
dl 0
loc 10
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A testLocalizedDescription() 0 8 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace EcodevTests\Felix\Api\Enum;
6
7
use Ecodev\Felix\Api\Enum\PhpEnumType;
8
use EcodevTests\Felix\Service\OtherTestEnum;
9
use EcodevTests\Felix\Service\TestEnum;
10
use PHPUnit\Framework\TestCase;
11
12
class PhpEnumTypeTest extends TestCase
13
{
14
    public function testLocalizedDescription(): void
15
    {
16
        $type = new PhpEnumType(TestEnum::class);
17
        self::assertSame('custom description for key 1', $type->getValues()[0]->description);
18
        self::assertSame('other for key 2', $type->getValues()[1]->description);
19
20
        $normalType = new PhpEnumType(OtherTestEnum::class);
21
        self::assertSame('static description via webonyx/graphql', $normalType->getValues()[0]->description, 'base features are still working');
22
    }
23
}
24