Some unit tests updated.

This commit is contained in:
Geoff Taylor
2020-06-19 18:44:21 -04:00
parent 14f5316a97
commit b98b1ae6ac
2 changed files with 4 additions and 94 deletions
+3 -93
View File
@@ -28,7 +28,7 @@ class IntrospectionQueryTest extends \Codeception\TestCase\WPTestCase
} catch (\GraphQL\Error\InvariantViolation $e) {
// use --debug flag to view.
codecept_debug( $e->getMessage() );
// Fail upon throwing
$this->assertTrue( false );
}
@@ -36,99 +36,9 @@ class IntrospectionQueryTest extends \Codeception\TestCase\WPTestCase
// Test introspection query.
public function testIntrospectionQuery() {
$query = '
query IntrospectionQuery {
__schema {
queryType { name }
mutationType { name }
subscriptionType { name }
types {
...FullType
}
directives {
name
description
locations
args {
...InputValue
}
}
}
}
fragment FullType on __Type {
kind
name
description
fields(includeDeprecated: true) {
name
description
args {
...InputValue
}
type {
...TypeRef
}
isDeprecated
deprecationReason
}
inputFields {
...InputValue
}
interfaces {
...TypeRef
}
enumValues(includeDeprecated: true) {
name
description
isDeprecated
deprecationReason
}
possibleTypes {
...TypeRef
}
}
fragment InputValue on __InputValue {
name
description
type { ...TypeRef }
defaultValue
}
fragment TypeRef on __Type {
kind
name
ofType {
kind
name
ofType {
kind
name
ofType {
kind
name
ofType {
kind
name
ofType {
kind
name
ofType {
kind
name
ofType {
kind
name
}
}
}
}
}
}
}
}
';
$query = \GraphQL\Type\Introspection::getIntrospectionQuery();
$results = graphql( array( 'query' => $query ) );
$this->assertArrayNotHasKey('errors', $results );
}
}
}
+1 -1
View File
@@ -175,7 +175,7 @@ class ProductQueriesTest extends \Codeception\TestCase\WPTestCase {
array(
'price' => 10,
'regular_price' => 10,
'category_ids' => array( $category_5, $category_6 ),
'category_ids' => array( $category_5 ),
'tag_ids' => array( $tag_2 ),
'image_id' => $attachment_id,
)