Releases: wp-graphql/wp-graphql-testcase
Releases · wp-graphql/wp-graphql-testcase
v2.2.0
What's Changed
- Add
PATH
to field match log. by @justlevine in #16 - Add phpunit 9.5 by @markkelnar in #17
- fix: set
NOT_FALSY
to..._not_falsy
. by @justlevine in #18 - fix: correctly fail when data doesnt match by @justlevine in #20
- fix: TraversableContains replaced with TraversableContainsIdentical by @kidunot89 in #21
New Contributors
- @justlevine made their first contribution in #16
- @markkelnar made their first contribution in #17
Full Changelog: v2.1.3...v2.2.0
v2.1.3
v2.1.2
v2.1.1
Release v2.1.0
Changelog
This update introduces some much need features and fixes some design flaws.
- Anonymous field value constants introduced
$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.- `WPGraphQLTestCommon::expectedObject() refactored. This should now be use when specific a group of sub rules on one path. See the example below for better understanding.
$this->expectedObject(
'post',
array(
$this->expectedField( 'id', $this->toRelayId( 'post', 100 ) ),
$this->expectedField( 'databaseId', 100 ),
$this->not()->expectedField( 'databaseId', 101 ),
)
- Better assertion usage and console error reporting in non-verbose modes.
Release v2.0.0
Changelog
- Feature: Nested node/edge rules introduced. See example test below
- Fix: Assertion count compressed.
$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 );
Release v1.1.3
Changelog
- "assertQueryError()" bugfix applied.
Release v1.1.2
Changelog
WPGraphQLTestCommon::clear_schema()
renamedWPGraphQLTestCommon::clearSchema()
WPGraphQLTestCommon::clearLoaderCache()
added.
Release v1.1.1
Changelog
- All
\codecept_debug()
calls in WPGraphQLTestCommon replaces with calls toWPGraphQLTestCommon::logData()
Thanks @renatonascalves for point these out. Sorry for wait on this patch 😅 WPGraphQLTestCommon::clear_schema()
implemented.
Release 1.1.0
Changelog
- WPGraphQLUnitTestCase implemented. Adds direct support for the
WP PHPUnit
library. - assertQueryError assertion implemented. Allows for precise error checking.
- not() modifier added. Inverses the
expectedObject()
,expectedNode()
, andexpectedEdge()
functions.