| @@ 63-76 (lines=14) @@ | ||
| 60 | /** |
|
| 61 | * @expectedException Youshido\GraphQL\Exception\ConfigurationException |
|
| 62 | */ |
|
| 63 | public function testInvalidTypesWithScalar() |
|
| 64 | { |
|
| 65 | $type = new UnionType([ |
|
| 66 | 'name' => 'Car', |
|
| 67 | 'description' => 'Union collect cars types', |
|
| 68 | 'types' => [ |
|
| 69 | 'test', new IntType() |
|
| 70 | ], |
|
| 71 | 'resolveType' => function ($type) { |
|
| 72 | return $type; |
|
| 73 | } |
|
| 74 | ]); |
|
| 75 | ConfigValidator::getInstance()->assertValidConfig($type->getConfig()); |
|
| 76 | } |
|
| 77 | ||
| 78 | /** |
|
| 79 | * @expectedException Youshido\GraphQL\Exception\ConfigurationException |
|
| @@ 81-94 (lines=14) @@ | ||
| 78 | /** |
|
| 79 | * @expectedException Youshido\GraphQL\Exception\ConfigurationException |
|
| 80 | */ |
|
| 81 | public function testInvalidTypes() |
|
| 82 | { |
|
| 83 | $type = new UnionType([ |
|
| 84 | 'name' => 'Car', |
|
| 85 | 'description' => 'Union collect cars types', |
|
| 86 | 'types' => [ |
|
| 87 | new IntType() |
|
| 88 | ], |
|
| 89 | 'resolveType' => function ($type) { |
|
| 90 | return $type; |
|
| 91 | } |
|
| 92 | ]); |
|
| 93 | ConfigValidator::getInstance()->assertValidConfig($type->getConfig()); |
|
| 94 | } |
|
| 95 | } |
|
| 96 | ||