1 | <?php |
||
6 | class Issue171Test extends \PHPUnit_Framework_TestCase |
||
7 | { |
||
8 | public function testItSetsDeprecationReasonToNullByDefault() |
||
9 | { |
||
10 | $schema = new Issue171Schema(); |
||
11 | $processor = new Processor($schema); |
||
12 | |||
13 | $processor->processPayload($this->getIntrospectionQuery(), []); |
||
14 | $resp = $processor->getResponseData(); |
||
15 | |||
16 | $enumTypes = array_filter($resp['data']['__schema']['types'], function($type){ |
||
17 | return ($type['kind'] === 'ENUM'); |
||
18 | }); |
||
19 | |||
20 | foreach ($enumTypes as $enumType) { |
||
21 | foreach ($enumType['enumValues'] as $value) { |
||
22 | $this->assertFalse($value['isDeprecated']); |
||
23 | $this->assertNull($value['deprecationReason'], "deprecationReason should have been null"); |
||
24 | } |
||
25 | } |
||
26 | } |
||
27 | |||
28 | private function getIntrospectionQuery() |
||
109 | } |