wp-graphql-testcase

WPGraphQL API Unit Testing Library supports WP-PHPUnit(PHPUnit) and WPBrowser(Codeception)

MIT License

Downloads
134.1K
Stars
7
Committers
5

Bot releases are hidden (Show)

wp-graphql-testcase - Release v3.1.0 Latest Release

Published by kidunot89 5 months ago

What's Changed

Full Changelog: https://github.com/wp-graphql/wp-graphql-testcase/compare/v3.0.1...v3.1.0

wp-graphql-testcase - Release v3.0.1

Published by kidunot89 6 months ago

What's Changed

Full Changelog: https://github.com/wp-graphql/wp-graphql-testcase/compare/v3.0.0...v3.0.1

wp-graphql-testcase - Release v3.0.0

Published by kidunot89 6 months ago

What's Changed

Full Changelog: https://github.com/wp-graphql/wp-graphql-testcase/compare/v2.4.1...v3.0.0

wp-graphql-testcase - Release v2.4.1

Published by kidunot89 6 months ago

wp-graphql-testcase - Release v2.4.0

Published by kidunot89 6 months ago

What's Changed

New Contributors

Full Changelog: https://github.com/wp-graphql/wp-graphql-testcase/compare/v2.3.0...v2.4.0

wp-graphql-testcase - v2.3.0

Published by jasonbahl over 2 years ago

What's Changed

New Contributors

Full Changelog: https://github.com/wp-graphql/wp-graphql-testcase/compare/v2.1.3...v2.3.0

wp-graphql-testcase - v2.2.0

Published by jasonbahl over 2 years ago

What's Changed

New Contributors

Full Changelog: https://github.com/wp-graphql/wp-graphql-testcase/compare/v2.1.3...v2.2.0

wp-graphql-testcase - v2.1.3

Published by jasonbahl over 3 years ago

  • fix typo in WPGraphQLTestCommon.php
wp-graphql-testcase - v2.1.2

Published by jasonbahl over 3 years ago

  • Update logData method to be a static method
wp-graphql-testcase - v2.1.1

Published by jasonbahl over 3 years ago

  • Updates composer.json to specify support for PHP 8+
  • Updates Github workflows to run tests for php 7 and php 8 versions
wp-graphql-testcase - Release v2.1.0

Published by kidunot89 over 3 years ago

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.
wp-graphql-testcase - Release v2.0.0

Published by kidunot89 over 3 years ago

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 );
wp-graphql-testcase - Release v1.1.3

Published by kidunot89 over 3 years ago

Changelog

  • "assertQueryError()" bugfix applied.
wp-graphql-testcase - Release v1.1.2

Published by kidunot89 over 3 years ago

Changelog

  • WPGraphQLTestCommon::clear_schema() renamed WPGraphQLTestCommon::clearSchema()
  • WPGraphQLTestCommon::clearLoaderCache() added.
wp-graphql-testcase - Release v1.1.1

Published by kidunot89 over 3 years ago

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.
wp-graphql-testcase - Release 1.1.0

Published by kidunot89 over 3 years ago

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.
wp-graphql-testcase - Release 1.0.1

Published by kidunot89 over 3 years ago

Changelog

  • Fix: Unneeded Codeception Modules removed from composer.json #1
wp-graphql-testcase - Release v1.0.0

Published by kidunot89 about 4 years ago

First official release of the WPGraphQL Testcase library.