1 | <?php |
||
25 | class InputFieldTest extends \PHPUnit_Framework_TestCase |
||
26 | { |
||
27 | |||
28 | private $introspectionQuery = <<<TEXT |
||
29 | |||
30 | query IntrospectionQuery { |
||
31 | __schema { |
||
32 | queryType { name } |
||
33 | mutationType { name } |
||
34 | types { |
||
35 | ...FullType |
||
36 | } |
||
37 | directives { |
||
38 | name |
||
39 | description |
||
40 | args { |
||
41 | ...InputValue |
||
42 | } |
||
43 | onOperation |
||
44 | onFragment |
||
45 | onField |
||
46 | } |
||
47 | } |
||
48 | } |
||
49 | |||
50 | fragment FullType on __Type { |
||
51 | kind |
||
52 | name |
||
53 | description |
||
54 | fields { |
||
55 | name |
||
56 | description |
||
57 | args { |
||
58 | ...InputValue |
||
59 | } |
||
60 | type { |
||
61 | ...TypeRef |
||
62 | } |
||
63 | isDeprecated |
||
64 | deprecationReason |
||
65 | } |
||
66 | inputFields { |
||
67 | ...InputValue |
||
68 | } |
||
69 | interfaces { |
||
70 | ...TypeRef |
||
71 | } |
||
72 | enumValues { |
||
73 | name |
||
74 | description |
||
75 | isDeprecated |
||
76 | deprecationReason |
||
77 | } |
||
78 | possibleTypes { |
||
79 | ...TypeRef |
||
80 | } |
||
81 | } |
||
82 | |||
83 | fragment InputValue on __InputValue { |
||
84 | name |
||
85 | description |
||
86 | type { ...TypeRef } |
||
87 | defaultValue |
||
88 | } |
||
89 | |||
90 | fragment TypeRef on __Type { |
||
91 | kind |
||
92 | name |
||
93 | ofType { |
||
94 | kind |
||
95 | name |
||
96 | ofType { |
||
97 | kind |
||
98 | name |
||
99 | ofType { |
||
100 | kind |
||
101 | name |
||
102 | } |
||
103 | } |
||
104 | } |
||
105 | } |
||
106 | TEXT; |
||
107 | |||
108 | public function testFieldWithInputFieldArgument() |
||
135 | |||
136 | public function testInlineInputFieldCreation() |
||
150 | |||
151 | |||
152 | public function testObjectInputFieldCreation() |
||
161 | |||
162 | public function testListAsInputField() |
||
169 | |||
170 | /** |
||
171 | * @dataProvider invalidInputFieldProvider |
||
172 | * @expectedException Youshido\GraphQL\Exception\ConfigurationException |
||
173 | */ |
||
174 | public function testInvalidInputFieldParams($fieldConfig) |
||
179 | |||
180 | public function invalidInputFieldProvider() |
||
202 | } |
||
203 |