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

PhpEnumTypeTest::testLocalizedDescription()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
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 8
rs 10
cc 1
nc 1
nop 0
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