We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
@@ 53-69 (lines=17) @@ | ||
50 | * @param $idFetcherCallbackArg |
|
51 | * @param $nodeInterfaceType |
|
52 | */ |
|
53 | public function testValidConfig($idFetcher, $idFetcherCallbackArg, $nodeInterfaceType = 'node') |
|
54 | { |
|
55 | $config = [ |
|
56 | 'idFetcher' => $idFetcher, |
|
57 | 'inputType' => 'UserInput', |
|
58 | 'nodeInterfaceType' => $nodeInterfaceType, |
|
59 | ]; |
|
60 | ||
61 | $expected = [ |
|
62 | 'description' => 'Fetches an object given its ID', |
|
63 | 'type' => $nodeInterfaceType, |
|
64 | 'args' => ['id' => ['type' => 'ID!', 'description' => 'The ID of an object']], |
|
65 | 'resolve' => '@=resolver(\'relay_node_field\', [args, idFetcherCallback('.$idFetcherCallbackArg.')])', |
|
66 | ]; |
|
67 | ||
68 | $this->assertEquals($expected, $this->definition->toMappingDefinition($config)); |
|
69 | } |
|
70 | ||
71 | public function validConfigProvider() |
|
72 | { |
@@ 97-113 (lines=17) @@ | ||
94 | * |
|
95 | * @dataProvider validConfigProvider |
|
96 | */ |
|
97 | public function testValidConfig($resolveSingleInput, $expectedResolveSingleInputCallbackArg) |
|
98 | { |
|
99 | $config = [ |
|
100 | 'argName' => 'username', |
|
101 | 'inputType' => 'UserInput', |
|
102 | 'outputType' => 'User', |
|
103 | 'resolveSingleInput' => $resolveSingleInput, |
|
104 | ]; |
|
105 | ||
106 | $expected = [ |
|
107 | 'type' => '[User]', |
|
108 | 'args' => ['username' => ['type' => '[UserInput!]!']], |
|
109 | 'resolve' => '@=resolver(\'relay_plural_identifying_field\', [args[\'username\'], resolveSingleInputCallback('.$expectedResolveSingleInputCallbackArg.')])', |
|
110 | ]; |
|
111 | ||
112 | $this->assertEquals($expected, $this->definition->toMappingDefinition($config)); |
|
113 | } |
|
114 | ||
115 | public function validConfigProvider() |
|
116 | { |