mirror of
https://github.com/wp-graphql/wp-graphql-woocommerce.git
synced 2026-08-14 12:53:44 +02:00
Some unit tests updated.
This commit is contained in:
@@ -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 );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user