mirror of
https://github.com/retailcrm/graphql-php.git
synced 2024-11-25 14:26:08 +03:00
Updated introspection test
This commit is contained in:
parent
56e91d008e
commit
0d93d190f8
@ -1077,7 +1077,7 @@ class IntrospectionTest extends TestCase
|
||||
$TestInputObject = new InputObjectType([
|
||||
'name' => 'TestInputObject',
|
||||
'fields' => [
|
||||
'a' => ['type' => Type::string(), 'defaultValue' => 'foo'],
|
||||
'a' => ['type' => Type::string(), 'defaultValue' => "tes\t de\fault"],
|
||||
'b' => ['type' => Type::listOf(Type::string())],
|
||||
'c' => ['type' => Type::string(), 'defaultValue' => null ]
|
||||
]
|
||||
@ -1099,8 +1099,7 @@ class IntrospectionTest extends TestCase
|
||||
$schema = new Schema(['query' => $TestType]);
|
||||
$request = '
|
||||
{
|
||||
__schema {
|
||||
types {
|
||||
__type(name: "TestInputObject") {
|
||||
kind
|
||||
name
|
||||
inputFields {
|
||||
@ -1110,7 +1109,6 @@ class IntrospectionTest extends TestCase
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fragment TypeRef on __Type {
|
||||
kind
|
||||
@ -1142,7 +1140,7 @@ class IntrospectionTest extends TestCase
|
||||
'name' => 'String',
|
||||
'ofType' => null
|
||||
],
|
||||
'defaultValue' => '"foo"'
|
||||
'defaultValue' => '"tes\t de\fault"'
|
||||
],
|
||||
[
|
||||
'name' => 'b',
|
||||
@ -1166,9 +1164,8 @@ class IntrospectionTest extends TestCase
|
||||
];
|
||||
|
||||
$result = GraphQL::executeQuery($schema, $request)->toArray();
|
||||
$result = $result['data']['__schema']['types'];
|
||||
// $this->assertEquals($expectedFragment, $result[1]);
|
||||
$this->assertContains($expectedFragment, $result);
|
||||
$result = $result['data']['__type'];
|
||||
$this->assertEquals($expectedFragment, $result);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user