Updated introspection test

This commit is contained in:
Vladimir Razuvaev 2018-08-08 15:11:33 +07:00
parent 56e91d008e
commit 0d93d190f8

View File

@ -1077,7 +1077,7 @@ class IntrospectionTest extends TestCase
$TestInputObject = new InputObjectType([ $TestInputObject = new InputObjectType([
'name' => 'TestInputObject', 'name' => 'TestInputObject',
'fields' => [ 'fields' => [
'a' => ['type' => Type::string(), 'defaultValue' => 'foo'], 'a' => ['type' => Type::string(), 'defaultValue' => "tes\t de\fault"],
'b' => ['type' => Type::listOf(Type::string())], 'b' => ['type' => Type::listOf(Type::string())],
'c' => ['type' => Type::string(), 'defaultValue' => null ] 'c' => ['type' => Type::string(), 'defaultValue' => null ]
] ]
@ -1099,15 +1099,13 @@ class IntrospectionTest extends TestCase
$schema = new Schema(['query' => $TestType]); $schema = new Schema(['query' => $TestType]);
$request = ' $request = '
{ {
__schema { __type(name: "TestInputObject") {
types { kind
kind name
inputFields {
name name
inputFields { type { ...TypeRef }
name defaultValue
type { ...TypeRef }
defaultValue
}
} }
} }
} }
@ -1142,7 +1140,7 @@ class IntrospectionTest extends TestCase
'name' => 'String', 'name' => 'String',
'ofType' => null 'ofType' => null
], ],
'defaultValue' => '"foo"' 'defaultValue' => '"tes\t de\fault"'
], ],
[ [
'name' => 'b', 'name' => 'b',
@ -1166,9 +1164,8 @@ class IntrospectionTest extends TestCase
]; ];
$result = GraphQL::executeQuery($schema, $request)->toArray(); $result = GraphQL::executeQuery($schema, $request)->toArray();
$result = $result['data']['__schema']['types']; $result = $result['data']['__type'];
// $this->assertEquals($expectedFragment, $result[1]); $this->assertEquals($expectedFragment, $result);
$this->assertContains($expectedFragment, $result);
} }
/** /**