Code Duplication    Length = 20-21 lines in 2 locations

tests/Type/ValidatedFieldDefinition/BasicTest.php 2 locations

@@ 12-31 (lines=20) @@
9
10
final class BasicTest extends TestCase
11
{
12
    public function testInferName()
13
    {
14
        $def = new NamelessDef([
15
            'type' => Type::boolean(),
16
            'args' => [
17
                'bookId' => [
18
                    'type' => Type::id(),
19
                    'errorCodes' => ['bookNotFound'],
20
                    'validate' => static function ($bookId) {
21
                        return $bookId ? 0 : 1;
22
                    },
23
                ],
24
            ],
25
            'resolve' => static function ($value) : bool {
26
                return !!$value;
27
            },
28
        ]);
29
30
        static::assertEquals('namelessDef', $def->name);
31
    }
32
33
    public function testInferNameNameAlreadyExists()
34
    {
@@ 33-53 (lines=21) @@
30
        static::assertEquals('namelessDef', $def->name);
31
    }
32
33
    public function testInferNameNameAlreadyExists()
34
    {
35
        $def = new NamelessDef([
36
            'name' => 'FooDef',
37
            'type' => Type::boolean(),
38
            'args' => [
39
                'bookId' => [
40
                    'type' => Type::id(),
41
                    'errorCodes' => ['bookNotFound'],
42
                    'validate' => static function ($bookId) {
43
                        return $bookId ? 0 : 1;
44
                    },
45
                ],
46
            ],
47
            'resolve' => static function ($value) : bool {
48
                return !!$value;
49
            },
50
        ]);
51
52
        static::assertEquals('FooDef', $def->name);
53
    }
54
}
55