WPGraphQL API Unit Testing Library supports WP-PHPUnit(PHPUnit) and WPBrowser(Codeception)
MIT License
Bot releases are hidden (Show)
Full Changelog: https://github.com/wp-graphql/wp-graphql-testcase/compare/v3.0.1...v3.1.0
Published by kidunot89 6 months ago
Full Changelog: https://github.com/wp-graphql/wp-graphql-testcase/compare/v3.0.0...v3.0.1
Published by kidunot89 6 months ago
Full Changelog: https://github.com/wp-graphql/wp-graphql-testcase/compare/v2.4.1...v3.0.0
Published by kidunot89 6 months ago
Full Changelog: https://github.com/wp-graphql/wp-graphql-testcase/compare/v2.4.0...v2.4.1
Published by kidunot89 6 months ago
$this->not
property is set before attempting to access. by @missionmike in https://github.com/wp-graphql/wp-graphql-testcase/pull/24
Full Changelog: https://github.com/wp-graphql/wp-graphql-testcase/compare/v2.3.0...v2.4.0
Published by jasonbahl over 2 years ago
PATH
to field match log. by @justlevine in https://github.com/wp-graphql/wp-graphql-testcase/pull/16
NOT_FALSY
to ..._not_falsy
. by @justlevine in https://github.com/wp-graphql/wp-graphql-testcase/pull/18
Full Changelog: https://github.com/wp-graphql/wp-graphql-testcase/compare/v2.1.3...v2.3.0
Published by jasonbahl over 2 years ago
PATH
to field match log. by @justlevine in https://github.com/wp-graphql/wp-graphql-testcase/pull/16
NOT_FALSY
to ..._not_falsy
. by @justlevine in https://github.com/wp-graphql/wp-graphql-testcase/pull/18
Full Changelog: https://github.com/wp-graphql/wp-graphql-testcase/compare/v2.1.3...v2.2.0
Published by jasonbahl over 3 years ago
Published by jasonbahl over 3 years ago
Published by jasonbahl over 3 years ago
Published by kidunot89 over 3 years ago
This update introduces some much need features and fixes some design flaws.
$this->expectedField( 'some.field', self::IS_NULL )
. They should be used with the following values match the expected value desired.
IS_NULL
NOT_NULL
IS_FALSY
NOT_FALSY
WPGraphQLTestCommon::expectedField()
added. This should be use when specific the value of a field.$this->expectedObject(
'post',
array(
$this->expectedField( 'id', $this->toRelayId( 'post', 100 ) ),
$this->expectedField( 'databaseId', 100 ),
$this->not()->expectedField( 'databaseId', 101 ),
)
Published by kidunot89 over 3 years ago
$post_id = $this->factory()->post->create();
$term_id = $this->factory()->term->create( array( 'taxonomy' => 'category' ) );
wp_set_object_terms( $post_id, array( $term_id ), 'category' );
$query = '
query {
posts {
edges {
node {
databaseId
categories {
edges {
node {
databaseId
}
}
}
}
}
}
}
';
$response = $this->graphql( compact( 'query' ) );
$expected = array(
$this->expectedEdge(
'posts.edges',
array(
$this->expectedObject( 'databaseId', $post_id ),
$this->expectedEdge(
'categories.edges',
array(
$this->expectedObject( 'databaseId', $term_id )
)
),
),
0
)
);
$this->assertQuerySuccessful( $response, $expected );
Published by kidunot89 over 3 years ago
Published by kidunot89 over 3 years ago
WPGraphQLTestCommon::clear_schema()
renamed WPGraphQLTestCommon::clearSchema()
WPGraphQLTestCommon::clearLoaderCache()
added.Published by kidunot89 over 3 years ago
\codecept_debug()
calls in WPGraphQLTestCommon replaces with calls to WPGraphQLTestCommon::logData()
Thanks @renatonascalves for point these out. Sorry for wait on this patch 😅WPGraphQLTestCommon::clear_schema()
implemented.Published by kidunot89 over 3 years ago
WP PHPUnit
library.expectedObject()
, expectedNode()
, and expectedEdge()
functions.Published by kidunot89 over 3 years ago
composer.json
#1Published by kidunot89 about 4 years ago
First official release of the WPGraphQL Testcase library.