Skip to content

Releases: wp-graphql/wp-graphql-testcase

v2.2.0

25 May 14:53
d4c0bd7
Compare
Choose a tag to compare

What's Changed

New Contributors

Full Changelog: v2.1.3...v2.2.0

v2.1.3

02 Jul 21:05
c37e7a7
Compare
Choose a tag to compare
  • fix typo in WPGraphQLTestCommon.php

v2.1.2

02 Jul 20:43
249cdb0
Compare
Choose a tag to compare
  • Update logData method to be a static method

v2.1.1

02 Jul 20:30
5eed0c5
Compare
Choose a tag to compare
  • Updates composer.json to specify support for PHP 8+
  • Updates Github workflows to run tests for php 7 and php 8 versions

Release v2.1.0

27 Jun 05:15
2cae894
Compare
Choose a tag to compare

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

12 Jun 19:27
Compare
Choose a tag to compare

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

02 Jun 23:49
Compare
Choose a tag to compare

Changelog

  • "assertQueryError()" bugfix applied.

Release v1.1.2

30 May 21:43
ce08b71
Compare
Choose a tag to compare

Changelog

  • WPGraphQLTestCommon::clear_schema() renamed WPGraphQLTestCommon::clearSchema()
  • WPGraphQLTestCommon::clearLoaderCache() added.

Release v1.1.1

19 May 21:49
9650e0c
Compare
Choose a tag to compare

Changelog

  • All \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.

Release 1.1.0

31 Mar 08:05
79e48d5
Compare
Choose a tag to compare

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(), and expectedEdge() functions.