Merge branch 'release-v0.3.1' of github.com:wp-graphql/wp-graphql-woocommerce into bugfix/woocommerce-cart-session

This commit is contained in:
Geoff Taylor
2019-11-14 23:20:16 -05:00
35 changed files with 224 additions and 239 deletions
+2 -1
View File
@@ -1,3 +1,4 @@
.env
.github_changelog_generator
.travis.yml
.travis.yml
codeception.yml
+4 -1
View File
@@ -24,4 +24,7 @@ TESTS_DIR=tests
TESTS_OUTPUT=tests/_output
TESTS_DATA=tests/_data
TESTS_SUPPORT=tests/_support
TESTS_ENVS=tests/_envs
TESTS_ENVS=tests/_envs
CORE_BRANCH=develop
JWT_AUTH_BRANCH=master
+8 -13
View File
@@ -17,7 +17,7 @@ branches:
- master
- release-v0.1.2
- release-v0.2.2
- release-v0.3.0
- release-v0.3.1
cache:
apt: true
@@ -27,17 +27,13 @@ cache:
matrix:
include:
- php: 7.3
env: PHP_VERSION=7.3 WP_VERSION=5.2 COVERAGE=1
env: PHP_VERSION=7.3 WP_VERSION=5.3
- php: 7.3
env: PHP_VERSION=7.3 PHPCS=1
- php: 7.2
env: PHP_VERSION=7.2 WP_VERSION=5.2
env: PHP_VERSION=7.2 WP_VERSION=5.3
- php: 7.2
env: PHP_VERSION=7.2 WP_VERSION=4.9
- php: 7.1
env: PHP_VERSION=7.1 WP_VERSION=5.2
- php: 7.1
env: PHP_VERSION=7.1 WP_VERSION=4.9
- php: 7.0
env: PHP_VERSION=7.0 WP_VERSION=5.0
- php: 7.0
@@ -46,6 +42,10 @@ matrix:
env: PHP_VERSION=5.6 WP_VERSION=5.0
- php: 5.6
env: PHP_VERSION=5.6 WP_VERSION=4.9
- php: 7.1
env: PHP_VERSION=7.1 WP_VERSION=5.3
- php: 7.1
env: PHP_VERSION=7.1 WP_VERSION=4.9 COVERAGE=1
allow_failures:
- env: PHP_VERSION=5.6 WP_VERSION=5.0
- env: PHP_VERSION=5.6 WP_VERSION=4.9
@@ -93,11 +93,7 @@ script:
# Execute unit tests with coverage if specified, otherwise without coverage
- |
if [ ! -z "$WP_VERSION" ]; then
docker-compose run --rm \
-e SUITES='acceptance;functional;wpunit' \
-e COVERAGE=${COVERAGE:-0} \
-e DEBUG=${DEBUG:-0} \
testing --scale app=0
docker-compose run --rm -e COVERAGE=${COVERAGE:-0} -e DEBUG=${DEBUG:-0} testing --scale app=0
fi
- |
if [ "$PHPCS" == "1" ]; then
@@ -117,4 +113,3 @@ after_success:
sed -i 's/\/var\/www\/html\/wp-content\/plugins\/wp-graphql-woocommerce\///g' tests/_output/coverage.xml
travis_retry php php-coveralls.phar -v
fi
-69
View File
@@ -4,10 +4,6 @@
[Full Changelog](https://github.com/wp-graphql/wp-graphql-woocommerce/compare/v0.2.2-beta...v0.3.0-beta)
**Merged pull requests:**
- Release-v0.2.2 [\#154](https://github.com/wp-graphql/wp-graphql-woocommerce/pull/154) ([kidunot89](https://github.com/kidunot89))
## [v0.2.2-beta](https://github.com/wp-graphql/wp-graphql-woocommerce/tree/v0.2.2-beta) (2019-10-24)
[Full Changelog](https://github.com/wp-graphql/wp-graphql-woocommerce/compare/v0.2.1-beta...v0.2.2-beta)
@@ -16,9 +12,6 @@
- Sorting of products, Categories etc [\#138](https://github.com/wp-graphql/wp-graphql-woocommerce/issues/138)
- Accessing meta\_data product property? [\#121](https://github.com/wp-graphql/wp-graphql-woocommerce/issues/121)
- Improved ordering for some connections [\#145](https://github.com/wp-graphql/wp-graphql-woocommerce/pull/145) ([kidunot89](https://github.com/kidunot89))
- "product\_connection\_catalog\_visibility" hook implemented. [\#142](https://github.com/wp-graphql/wp-graphql-woocommerce/pull/142) ([kidunot89](https://github.com/kidunot89))
- "format" arg added to Product description fields [\#139](https://github.com/wp-graphql/wp-graphql-woocommerce/pull/139) ([kidunot89](https://github.com/kidunot89))
**Fixed:**
@@ -27,10 +20,6 @@
- Extension breaks the hierarchy between pages [\#122](https://github.com/wp-graphql/wp-graphql-woocommerce/issues/122)
- Order id undefined [\#119](https://github.com/wp-graphql/wp-graphql-woocommerce/issues/119)
- categoryNameIn not filtering [\#116](https://github.com/wp-graphql/wp-graphql-woocommerce/issues/116)
- Fixes product taxonomy hierachy resolution [\#150](https://github.com/wp-graphql/wp-graphql-woocommerce/pull/150) ([kidunot89](https://github.com/kidunot89))
- Adds WPGraphQL JWT Auth fields to Customer type and mutations [\#148](https://github.com/wp-graphql/wp-graphql-woocommerce/pull/148) ([kidunot89](https://github.com/kidunot89))
- Escape hatch added on non-GraphQL requests. [\#146](https://github.com/wp-graphql/wp-graphql-woocommerce/pull/146) ([kidunot89](https://github.com/kidunot89))
- Release v0.2.1 [\#114](https://github.com/wp-graphql/wp-graphql-woocommerce/pull/114) ([kidunot89](https://github.com/kidunot89))
**Closed issues:**
@@ -39,20 +28,10 @@
- Price Type, and name not showing up for product as Typed values [\#137](https://github.com/wp-graphql/wp-graphql-woocommerce/issues/137)
- Add AND and OR statement to where clause. [\#120](https://github.com/wp-graphql/wp-graphql-woocommerce/issues/120)
**Merged pull requests:**
- FUNDING.yml added. [\#151](https://github.com/wp-graphql/wp-graphql-woocommerce/pull/151) ([kidunot89](https://github.com/kidunot89))
- CONTRIBUTING.md added [\#144](https://github.com/wp-graphql/wp-graphql-woocommerce/pull/144) ([kidunot89](https://github.com/kidunot89))
- v0.2.1 hotfix to develop [\#135](https://github.com/wp-graphql/wp-graphql-woocommerce/pull/135) ([kidunot89](https://github.com/kidunot89))
## [v0.2.1-beta](https://github.com/wp-graphql/wp-graphql-woocommerce/tree/v0.2.1-beta) (2019-08-27)
[Full Changelog](https://github.com/wp-graphql/wp-graphql-woocommerce/compare/v0.2.0-beta...v0.2.1-beta)
**Breaking changes:**
- Release v0.2.0 [\#96](https://github.com/wp-graphql/wp-graphql-woocommerce/pull/96) ([kidunot89](https://github.com/kidunot89))
**Enhancements:**
- Hooks for mutations [\#108](https://github.com/wp-graphql/wp-graphql-woocommerce/issues/108)
@@ -65,7 +44,6 @@
- customerRegister mutation resolves wrong object for `viewer` field [\#111](https://github.com/wp-graphql/wp-graphql-woocommerce/issues/111)
- I cant see the category thumbnail [\#93](https://github.com/wp-graphql/wp-graphql-woocommerce/issues/93)
- Session header bugfix [\#113](https://github.com/wp-graphql/wp-graphql-woocommerce/pull/113) ([kidunot89](https://github.com/kidunot89))
## [v0.2.0-beta](https://github.com/wp-graphql/wp-graphql-woocommerce/tree/v0.2.0-beta) (2019-07-11)
@@ -74,24 +52,15 @@
**Fixed:**
- Custom attributes of variable products cannot be queried. [\#87](https://github.com/wp-graphql/wp-graphql-woocommerce/issues/87)
- Release v0.1.2 [\#86](https://github.com/wp-graphql/wp-graphql-woocommerce/pull/86) ([kidunot89](https://github.com/kidunot89))
**Closed issues:**
- Customer id doesn't match user id [\#90](https://github.com/wp-graphql/wp-graphql-woocommerce/issues/90)
**Merged pull requests:**
- CHANGELOG updated [\#92](https://github.com/wp-graphql/wp-graphql-woocommerce/pull/92) ([kidunot89](https://github.com/kidunot89))
## [v0.1.2-beta](https://github.com/wp-graphql/wp-graphql-woocommerce/tree/v0.1.2-beta) (2019-06-23)
[Full Changelog](https://github.com/wp-graphql/wp-graphql-woocommerce/compare/v0.1.1-beta...v0.1.2-beta)
**Fixed:**
- Release v0.1.1 [\#81](https://github.com/wp-graphql/wp-graphql-woocommerce/pull/81) ([kidunot89](https://github.com/kidunot89))
**Closed issues:**
- Tests needed [\#46](https://github.com/wp-graphql/wp-graphql-woocommerce/issues/46)
@@ -100,10 +69,6 @@
[Full Changelog](https://github.com/wp-graphql/wp-graphql-woocommerce/compare/v0.1.0-beta...v0.1.1-beta)
**Breaking changes:**
- Release v0.1.0 [\#54](https://github.com/wp-graphql/wp-graphql-woocommerce/pull/54) ([kidunot89](https://github.com/kidunot89))
**Enhancements:**
- Add format argument to product pricing fields [\#75](https://github.com/wp-graphql/wp-graphql-woocommerce/issues/75)
@@ -113,7 +78,6 @@
**Fixed:**
- Provide guest user authentication [\#79](https://github.com/wp-graphql/wp-graphql-woocommerce/issues/79)
- Codeception versioning problem in Travis-CI build [\#77](https://github.com/wp-graphql/wp-graphql-woocommerce/pull/77) ([kidunot89](https://github.com/kidunot89))
**Closed issues:**
@@ -127,10 +91,6 @@
- Release v0.0.4 Summary [\#66](https://github.com/wp-graphql/wp-graphql-woocommerce/issues/66)
**Merged pull requests:**
- Release v0.0.4 [\#65](https://github.com/wp-graphql/wp-graphql-woocommerce/pull/65) ([kidunot89](https://github.com/kidunot89))
## [v0.0.4-beta](https://github.com/wp-graphql/wp-graphql-woocommerce/tree/v0.0.4-beta) (2019-05-10)
[Full Changelog](https://github.com/wp-graphql/wp-graphql-woocommerce/compare/v0.0.3-beta...v0.0.4-beta)
@@ -140,40 +100,23 @@
- Add filter for restricted\_cap in models [\#51](https://github.com/wp-graphql/wp-graphql-woocommerce/issues/51)
- Add name to ProductVariation [\#41](https://github.com/wp-graphql/wp-graphql-woocommerce/issues/41)
- Cart type and queries [\#12](https://github.com/wp-graphql/wp-graphql-woocommerce/issues/12)
- Adds "\*\_restricted\_cap" filters [\#53](https://github.com/wp-graphql/wp-graphql-woocommerce/pull/53) ([kidunot89](https://github.com/kidunot89))
- ProductAttribute completion [\#50](https://github.com/wp-graphql/wp-graphql-woocommerce/pull/50) ([kidunot89](https://github.com/kidunot89))
**Fixed:**
- Query products by categories returns an empty array. [\#44](https://github.com/wp-graphql/wp-graphql-woocommerce/issues/44)
- More ProductVariation fields [\#49](https://github.com/wp-graphql/wp-graphql-woocommerce/pull/49) ([kidunot89](https://github.com/kidunot89))
- Bugfix/\#44 [\#45](https://github.com/wp-graphql/wp-graphql-woocommerce/pull/45) ([kidunot89](https://github.com/kidunot89))
**Merged pull requests:**
- to v0.0.3 [\#43](https://github.com/wp-graphql/wp-graphql-woocommerce/pull/43) ([kidunot89](https://github.com/kidunot89))
## [v0.0.3-beta](https://github.com/wp-graphql/wp-graphql-woocommerce/tree/v0.0.3-beta) (2019-04-25)
[Full Changelog](https://github.com/wp-graphql/wp-graphql-woocommerce/compare/v0.0.2-beta...v0.0.3-beta)
**Enhancements:**
- Cart-type and queries and customer query [\#30](https://github.com/wp-graphql/wp-graphql-woocommerce/pull/30) ([kidunot89](https://github.com/kidunot89))
**Fixed:**
- Pagination broken [\#29](https://github.com/wp-graphql/wp-graphql-woocommerce/issues/29)
- Pagination fix for CPT-backed CRUD objects connections [\#36](https://github.com/wp-graphql/wp-graphql-woocommerce/pull/36) ([kidunot89](https://github.com/kidunot89))
**Closed issues:**
- Unsetting "object\_ids" on all connections [\#39](https://github.com/wp-graphql/wp-graphql-woocommerce/issues/39)
**Merged pull requests:**
- Master [\#35](https://github.com/wp-graphql/wp-graphql-woocommerce/pull/35) ([kidunot89](https://github.com/kidunot89))
## [v0.0.2-beta](https://github.com/wp-graphql/wp-graphql-woocommerce/tree/v0.0.2-beta) (2019-04-22)
[Full Changelog](https://github.com/wp-graphql/wp-graphql-woocommerce/compare/0db77c26ab463e6203df99eed2679f79ce3e4d60...v0.0.2-beta)
@@ -182,22 +125,10 @@
- TaxClass type [\#27](https://github.com/wp-graphql/wp-graphql-woocommerce/issues/27)
- Order-Item type queries [\#13](https://github.com/wp-graphql/wp-graphql-woocommerce/issues/13)
- Order items, TaxRate, and ShippingMethod [\#28](https://github.com/wp-graphql/wp-graphql-woocommerce/pull/28) ([kidunot89](https://github.com/kidunot89))
- Where args for Coupon, Order, and Refund connections [\#24](https://github.com/wp-graphql/wp-graphql-woocommerce/pull/24) ([kidunot89](https://github.com/kidunot89))
- Testing and CI renovation [\#21](https://github.com/wp-graphql/wp-graphql-woocommerce/pull/21) ([kidunot89](https://github.com/kidunot89))
- WPGraphQL v0.3.0 migration [\#9](https://github.com/wp-graphql/wp-graphql-woocommerce/pull/9) ([kidunot89](https://github.com/kidunot89))
**Fixed:**
- no queries work [\#31](https://github.com/wp-graphql/wp-graphql-woocommerce/issues/31)
- after\_success script added [\#32](https://github.com/wp-graphql/wp-graphql-woocommerce/pull/32) ([kidunot89](https://github.com/kidunot89))
- Polishing Product types and connections [\#22](https://github.com/wp-graphql/wp-graphql-woocommerce/pull/22) ([kidunot89](https://github.com/kidunot89))
**Merged pull requests:**
- Formatting code to WordPress Coding Standards [\#8](https://github.com/wp-graphql/wp-graphql-woocommerce/pull/8) ([kidunot89](https://github.com/kidunot89))
- Feature/Product type [\#7](https://github.com/wp-graphql/wp-graphql-woocommerce/pull/7) ([kidunot89](https://github.com/kidunot89))
- Feature/coupon type [\#6](https://github.com/wp-graphql/wp-graphql-woocommerce/pull/6) ([kidunot89](https://github.com/kidunot89))
+6 -16
View File
@@ -20,27 +20,17 @@ if [[ -z "$TEST_DB_USER" ]]; then
else
DB_USER=$TEST_DB_USER
fi
if [[ -z "$TEST_DB_PASSWORD" ]]; then
DB_PASS=""
else
DB_PASS=$TEST_DB_PASSWORD
fi
if [[ -z "$TEST_DB_HOST" ]]; then
DB_HOST=localhost
else
DB_HOST=$TEST_DB_HOST
fi
if [ -z "$SKIP_DB_CREATE" ]; then
SKIP_DB_CREATE=false
fi
DB_HOST=${TEST_DB_HOST-localhost}
DB_PASS=${TEST_DB_PASSWORD-""}
WP_VERSION=${WP_VERSION-latest}
TMPDIR=${TMPDIR-/tmp}
TMPDIR=$(echo $TMPDIR | sed -e "s/\/$//")
WP_TESTS_DIR=${WP_TESTS_DIR-$TMPDIR/wordpress-tests-lib}
WP_CORE_DIR=${WP_CORE_DIR-$TMPDIR/wordpress/}
WP_CORE_DIR=${TEST_WP_ROOT_FOLDER-$TMPDIR/wordpress/}
PLUGIN_DIR=$(pwd)
DB_SERVE_NAME=${DB_SERVE_NAME-woographql_serve}
SKIP_DB_CREATE=${SKIP_DB_CREATE-false}
download() {
if [ `which curl` ]; then
@@ -193,14 +183,14 @@ setup_woocommerce() {
setup_wpgraphql() {
if [ ! -d $WP_CORE_DIR/wp-content/plugins/wp-graphql ]; then
echo "Cloning WPGraphQL"
wp plugin install https://github.com/wp-graphql/wp-graphql/archive/master.zip
wp plugin install https://github.com/wp-graphql/wp-graphql/archive/${CORE_BRANCH-master}.zip
fi
echo "Activating WPGraphQL"
wp plugin activate wp-graphql
if [ ! -d $WP_CORE_DIR/wp-content/plugins/wp-graphql-jwt-authentication ]; then
echo "Cloning WPGraphQL-JWT-Authentication"
wp plugin install https://github.com/wp-graphql/wp-graphql-jwt-authentication/archive/master.zip
wp plugin install https://github.com/wp-graphql/wp-graphql-jwt-authentication/archive/${JWT_AUTH_BRANCH-master}.zip
fi
echo "Activating WPGraphQL-JWT-Authentication"
wp plugin activate wp-graphql-jwt-authentication
+22 -15
View File
@@ -35,23 +35,30 @@ echo "Setting Codeception output directory permissions"
chmod 777 ${TESTS_OUTPUT}
if [[ -z "$SUITES" ]]; then
echo 'A target testing suite(s) must be selected.'
echo 'Using the environment variable "$SUITES" set on the "testing" service.'
exit 1
if [ "$COVERAGE" == "1" -a "$DEBUG" == "1" ]; then
vendor/bin/codecept run --debug --coverage --coverage-xml
elif [ "$COVERAGE" == "1" ]; then
vendor/bin/codecept run --coverage --coverage-xml
elif [ "$DEBUG" == "1" ]; then
vendor/bin/codecept run --debug
else
vendor/bin/codecept run
fi
else
IFS=';' read -ra target_suites <<< "$SUITES"
for suite in "${target_suites[@]}"; do
if [ "$COVERAGE" == "1" -a "$DEBUG" == "1" ]; then
vendor/bin/codecept run ${suite} --debug --coverage --coverage-xml
elif [ "$COVERAGE" == "1" ]; then
vendor/bin/codecept run ${suite} --coverage --coverage-xml
elif [ "$DEBUG" == "1" ]; then
vendor/bin/codecept run ${suite} --debug
else
vendor/bin/codecept run ${suite}
fi
done
fi
IFS=';' read -ra target_suites <<< "$SUITES"
for suite in "${target_suites[@]}"; do
if [ "$COVERAGE" == "1" -a "$DEBUG" == "1" ]; then
vendor/bin/codecept run ${suite} --debug --coverage --coverage-xml
elif [ "$COVERAGE" == "1" ]; then
vendor/bin/codecept run ${suite} --coverage --coverage-xml
elif [ "$DEBUG" == "1" ]; then
vendor/bin/codecept run ${suite} --debug
else
vendor/bin/codecept run ${suite}
fi
done
if [ -f "${TESTS_OUTPUT}" ]; then
echo 'Setting "coverage.xml" permissions'.
+4 -3
View File
@@ -1,7 +1,7 @@
{
"name": "wp-graphql/wp-graphql-woocommerce",
"description": "WooCommerce bindings for wp-graphql",
"version": "0.3.0",
"description": "WooCommerce bindings for WPGraphQL",
"version": "0.3.1",
"type": "wordpress-plugin",
"keywords": [
"wordpress",
@@ -32,7 +32,8 @@
},
"autoload": {
"files":[
"includes/connection/common-post-type-args.php"
"includes/connection/common-post-type-args.php",
"includes/functions.php"
],
"psr-4": {
"WPGraphQL\\WooCommerce\\": "includes/"
-1
View File
@@ -36,7 +36,6 @@ class Core_Schema_Filters {
// Registers WooCommerce CPTs.
add_filter( 'register_post_type_args', array( __CLASS__, 'register_post_types' ), 10, 2 );
add_filter( 'graphql_post_entities_allowed_post_types', array( __CLASS__, 'skip_type_registry' ), 10 );
add_filter( 'graphql_union_resolve_type', array( __CLASS__, 'graphql_union_resolve_type' ), 10, 3 );
// Registers WooCommerce taxonomies.
add_filter( 'register_taxonomy_args', array( __CLASS__, 'register_taxonomy_args' ), 10, 2 );
+6 -5
View File
@@ -1,7 +1,5 @@
<?php
/**
* WP_GraphQL_WooCommerce
*
* Initializes a singleton instance of WP_GraphQL_WooCommerce
*
* @package WPGraphQL\WooCommerce
@@ -18,9 +16,9 @@ if ( ! class_exists( 'WP_GraphQL_WooCommerce' ) ) :
final class WP_GraphQL_WooCommerce {
/**
* Stores the instance of the WPGraphQL\Extensions\WPGraphQLWooCommerce class
* Stores the instance of the WP_GraphQL_WooCommerce class
*
* @var WP_GraphQL_WooCommerce The one true WPGraphQL\Extensions\WP_GraphQL_WooCommerce
* @var WP_GraphQL_WooCommerce The one true WP_GraphQL_WooCommerce
* @access private
*/
private static $instance;
@@ -38,7 +36,7 @@ if ( ! class_exists( 'WP_GraphQL_WooCommerce' ) ) :
/**
* Fire off init action
*
* @param WP_GraphQL_WooCommerce $instance The instance of the WPGraphQLWooCommerce class
* @param WP_GraphQL_WooCommerce $instance The instance of the WP_GraphQL_WooCommerce class
*/
do_action( 'graphql_woocommerce_init', self::$instance );
@@ -158,6 +156,9 @@ if ( ! class_exists( 'WP_GraphQL_WooCommerce' ) ) :
* Sets up WooGraphQL schema.
*/
private function setup() {
// Setup minor integrations.
\WPGraphQL\WooCommerce\Functions\setup_minor_integrations();
// Register WooCommerce filters.
\WPGraphQL\WooCommerce\WooCommerce_Filters::setup();
+1
View File
@@ -28,6 +28,7 @@ use WPGraphQL\WooCommerce\Data\Connection\Shipping_Method_Connection_Resolver;
use WPGraphQL\WooCommerce\Data\Connection\Cart_Item_Connection_Resolver;
use WPGraphQL\WooCommerce\Data\Connection\Payment_Gateway_Connection_Resolver;
use WPGraphQL\WooCommerce\Model\Order_Item;
use WPGraphQL\WooCommerce\Model\Product;
use WPGraphQL\WooCommerce\Model\Tax_Rate;
use WPGraphQL\WooCommerce\Model\Shipping_Method;
+49
View File
@@ -0,0 +1,49 @@
<?php
/**
* Misc functions.
*
* @package WPGraphQL\WooCommerce
* @since 0.3.1
*/
namespace WPGraphQL\WooCommerce\Functions;
/**
* Initializes minor integrations with other WordPress plugins.
*/
function setup_minor_integrations() {
add_filter(
'graphql_swp_result_possible_types',
'WPGraphQL\WooCommerce\Functions\woographql_swp_result_possible_types',
10,
1
);
}
/**
* QL Search integration - Adds to product types to the SWPResult possible types
*
* @param array $type_names SWPResults possible types.
*
* @return array
*/
function woographql_swp_result_possible_types( $type_names ) {
if ( in_array( 'Product', $type_names, true ) ) {
$type_names = array_merge(
array_filter(
$type_names,
function( $type_name ) {
return 'Product' !== $type_name;
}
),
array(
'SimpleProduct',
'VariableProduct',
'GroupProduct',
'ExternalProduct',
)
);
}
return $type_names;
}
+3 -4
View File
@@ -224,10 +224,6 @@ class Product extends Crud_CPT {
'purchasable' => function () {
return ! is_null( $this->data->is_purchasable() ) ? $this->data->is_purchasable() : null;
},
'link' => function () {
$link = get_permalink( $this->data->ID );
return ! empty( $link ) ? $link : null;
},
/**
* Connection resolvers fields
*
@@ -264,6 +260,9 @@ class Product extends Crud_CPT {
'parent_id' => function() {
return ! empty( $this->data->get_parent_id() ) ? $this->data->get_parent_id() : null;
},
'post' => function() {
return ! empty( $this->data->post ) ? $this->data->post : null;
},
);
if ( 'grouped' !== $this->data->get_type() ) {
@@ -273,6 +273,10 @@ class Product {
'link' => array(
'type' => 'String',
'description' => __( 'The permalink of the post', 'wp-graphql' ),
'resolve' => function( $source ) {
$permalink = get_post_permalink( $source->ID );
return ! empty( $permalink ) ? $permalink : null;
},
),
);
}
@@ -366,7 +366,7 @@ class ProductHelper extends WCG_Helper {
'purchasable' => $data->is_purchasable(),
'shippingRequired' => $data->needs_shipping(),
'shippingTaxable' => $data->is_shipping_taxable(),
'link' => get_permalink( $data->get_id() ),
'link' => get_post_permalink( $id ),
);
}
+12 -12
View File
@@ -191,7 +191,7 @@ class CartMutationsTest extends \Codeception\TestCase\WPTestCase {
),
),
);
$this->assertEqualSets( $expected, $actual );
$this->assertEquals( $expected, $actual );
}
public function testAddToCartMutationWithProductVariation() {
@@ -241,7 +241,7 @@ class CartMutationsTest extends \Codeception\TestCase\WPTestCase {
),
),
);
$this->assertEqualSets( $expected, $actual );
$this->assertEquals( $expected, $actual );
}
public function testUpdateCartItemQuantitiesMutation() {
@@ -340,7 +340,7 @@ class CartMutationsTest extends \Codeception\TestCase\WPTestCase {
),
),
);
$this->assertEqualSets( $expected, $actual );
$this->assertEquals( $expected, $actual );
}
public function testRemoveItemsFromCartMutation() {
@@ -380,7 +380,7 @@ class CartMutationsTest extends \Codeception\TestCase\WPTestCase {
),
);
$this->assertEqualSets( $expected, $actual );
$this->assertEquals( $expected, $actual );
$this->assertEmpty( \WC()->cart->get_cart_item( $key ) );
}
@@ -440,7 +440,7 @@ class CartMutationsTest extends \Codeception\TestCase\WPTestCase {
),
);
$this->assertEqualSets( $expected, $actual );
$this->assertEquals( $expected, $actual );
$this->assertEmpty( \WC()->cart->get_cart_item( $key1 ) );
$this->assertEmpty( \WC()->cart->get_cart_item( $key2 ) );
}
@@ -501,7 +501,7 @@ class CartMutationsTest extends \Codeception\TestCase\WPTestCase {
),
);
$this->assertEqualSets( $expected, $actual );
$this->assertEquals( $expected, $actual );
$this->assertTrue( \WC()->cart->is_empty() );
}
@@ -552,7 +552,7 @@ class CartMutationsTest extends \Codeception\TestCase\WPTestCase {
),
);
$this->assertEqualSets( $expected, $actual );
$this->assertEquals( $expected, $actual );
$this->assertNotEmpty( \WC()->cart->get_cart_item( $key ) );
}
@@ -619,7 +619,7 @@ class CartMutationsTest extends \Codeception\TestCase\WPTestCase {
),
);
$this->assertEqualSets( $expected, $actual );
$this->assertEquals( $expected, $actual );
$this->assertNotEmpty( \WC()->cart->get_cart_item( $key1 ) );
$this->assertNotEmpty( \WC()->cart->get_cart_item( $key2 ) );
}
@@ -708,7 +708,7 @@ class CartMutationsTest extends \Codeception\TestCase\WPTestCase {
),
);
$this->assertEqualSets( $expected, $actual );
$this->assertEquals( $expected, $actual );
$this->assertTrue( \WC()->cart->is_empty() );
}
@@ -815,7 +815,7 @@ class CartMutationsTest extends \Codeception\TestCase\WPTestCase {
),
);
$this->assertEqualSets( $expected, $actual );
$this->assertEquals( $expected, $actual );
$new_total = \WC()->cart->get_cart_contents_total();
@@ -922,7 +922,7 @@ class CartMutationsTest extends \Codeception\TestCase\WPTestCase {
),
);
$this->assertEqualSets( $expected, $actual );
$this->assertEquals( $expected, $actual );
}
public function testAddFeeMutation() {
@@ -997,6 +997,6 @@ class CartMutationsTest extends \Codeception\TestCase\WPTestCase {
),
);
$this->assertEqualSets( $expected, $actual );
$this->assertEquals( $expected, $actual );
}
}
+5 -5
View File
@@ -67,7 +67,7 @@ class CartQueriesTest extends \Codeception\TestCase\WPTestCase {
// use --debug flag to view.
codecept_debug( $actual );
$this->assertEqualSets( $expected, $actual );
$this->assertEquals( $expected, $actual );
}
public function testCartItemQuery() {
@@ -112,7 +112,7 @@ class CartQueriesTest extends \Codeception\TestCase\WPTestCase {
// use --debug flag to view.
codecept_debug( $actual );
$this->assertEqualSets( $expected, $actual );
$this->assertEquals( $expected, $actual );
}
public function testCartItemConnection() {
@@ -160,7 +160,7 @@ class CartQueriesTest extends \Codeception\TestCase\WPTestCase {
// use --debug flag to view.
codecept_debug( $actual );
$this->assertEqualSets( $expected, $actual );
$this->assertEquals( $expected, $actual );
}
public function testCartFeeQuery() {
@@ -192,7 +192,7 @@ class CartQueriesTest extends \Codeception\TestCase\WPTestCase {
// use --debug flag to view.
codecept_debug( $actual );
$this->assertEqualSets( $expected, $actual );
$this->assertEquals( $expected, $actual );
}
public function testCartToCartFeeQuery() {
@@ -225,6 +225,6 @@ class CartQueriesTest extends \Codeception\TestCase\WPTestCase {
// use --debug flag to view.
codecept_debug( $actual );
$this->assertEqualSets( $expected, $actual );
$this->assertEquals( $expected, $actual );
}
}
+3 -3
View File
@@ -431,7 +431,7 @@ class CheckoutMutationsTest extends \Codeception\TestCase\WPTestCase {
)
);
$this->assertEqualSets( $expected, $actual );
$this->assertEquals( $expected, $actual );
}
public function testCheckoutOrderMutationWithNewAccount() {
@@ -616,7 +616,7 @@ class CheckoutMutationsTest extends \Codeception\TestCase\WPTestCase {
)
);
$this->assertEqualSets( $expected, $actual );
$this->assertEquals( $expected, $actual );
}
public function testCheckoutOrderMutationWithNoAccount() {
@@ -805,6 +805,6 @@ class CheckoutMutationsTest extends \Codeception\TestCase\WPTestCase {
)
);
$this->assertEqualSets( $expected, $actual );
$this->assertEquals( $expected, $actual );
}
}
+9 -9
View File
@@ -96,7 +96,7 @@ class CouponQueriesTest extends \Codeception\TestCase\WPTestCase {
// use --debug flag to view.
codecept_debug( $actual );
$this->assertEqualSets( $expected, $actual );
$this->assertEquals( $expected, $actual );
}
public function testCouponByQueryAndArgs() {
@@ -123,7 +123,7 @@ class CouponQueriesTest extends \Codeception\TestCase\WPTestCase {
// use --debug flag to view.
codecept_debug( $actual );
$this->assertEqualSets( $expected, $actual );
$this->assertEquals( $expected, $actual );
/**
* Assertion Two
@@ -137,7 +137,7 @@ class CouponQueriesTest extends \Codeception\TestCase\WPTestCase {
// use --debug flag to view.
codecept_debug( $actual );
$this->assertEqualSets( $expected, $actual );
$this->assertEquals( $expected, $actual );
/**
* Assertion Three
@@ -151,7 +151,7 @@ class CouponQueriesTest extends \Codeception\TestCase\WPTestCase {
// use --debug flag to view.
codecept_debug( $actual );
$this->assertEqualSets( $expected, $actual );
$this->assertEquals( $expected, $actual );
}
public function testCouponsQueryAndWhereArgs() {
@@ -195,7 +195,7 @@ class CouponQueriesTest extends \Codeception\TestCase\WPTestCase {
// use --debug flag to view.
codecept_debug( $actual );
$this->assertEqualSets( $expected, $actual );
$this->assertEquals( $expected, $actual );
/**
@@ -210,7 +210,7 @@ class CouponQueriesTest extends \Codeception\TestCase\WPTestCase {
// use --debug flag to view.
codecept_debug( $actual );
$this->assertEqualSets( $expected, $actual );
$this->assertEquals( $expected, $actual );
/**
* Assertion Three
@@ -239,7 +239,7 @@ class CouponQueriesTest extends \Codeception\TestCase\WPTestCase {
// use --debug flag to view.
codecept_debug( $actual );
$this->assertEqualSets( $expected, $actual );
$this->assertEquals( $expected, $actual );
/**
* Assertion Four
@@ -267,7 +267,7 @@ class CouponQueriesTest extends \Codeception\TestCase\WPTestCase {
// use --debug flag to view.
codecept_debug( $actual );
$this->assertEqualSets( $expected, $actual );
$this->assertEquals( $expected, $actual );
/**
* Assertion Five
@@ -295,6 +295,6 @@ class CouponQueriesTest extends \Codeception\TestCase\WPTestCase {
// use --debug flag to view.
codecept_debug( $actual );
$this->assertEqualSets( $expected, $actual );
$this->assertEquals( $expected, $actual );
}
}
+6 -6
View File
@@ -247,7 +247,7 @@ class CustomerMutationsTest extends \Codeception\TestCase\WPTestCase {
),
);
$this->assertEqualSets( $expected, $actual );
$this->assertEquals( $expected, $actual );
}
public function testRegisterMutationWithBillingInfo() {
@@ -296,7 +296,7 @@ class CustomerMutationsTest extends \Codeception\TestCase\WPTestCase {
),
);
$this->assertEqualSets( $expected, $actual );
$this->assertEquals( $expected, $actual );
}
public function testRegisterMutationWithShippingSameAsBillingInfo() {
@@ -349,7 +349,7 @@ class CustomerMutationsTest extends \Codeception\TestCase\WPTestCase {
),
);
$this->assertEqualSets( $expected, $actual );
$this->assertEquals( $expected, $actual );
}
public function testRegisterMutationWithBillingAndShippingInfo() {
@@ -399,7 +399,7 @@ class CustomerMutationsTest extends \Codeception\TestCase\WPTestCase {
),
);
$this->assertEqualSets( $expected, $actual );
$this->assertEquals( $expected, $actual );
}
public function testUpdateMutation() {
@@ -458,7 +458,7 @@ class CustomerMutationsTest extends \Codeception\TestCase\WPTestCase {
),
);
$this->assertEqualSets( $expected, $actual );
$this->assertEquals( $expected, $actual );
}
public function testUpdateMutationWithShippingSameAsBilling() {
@@ -516,6 +516,6 @@ class CustomerMutationsTest extends \Codeception\TestCase\WPTestCase {
),
);
$this->assertEqualSets( $expected, $actual );
$this->assertEquals( $expected, $actual );
}
}
+16 -16
View File
@@ -91,7 +91,7 @@ class CustomerQueriesTest extends \Codeception\TestCase\WPTestCase {
// use --debug flag to view.
codecept_debug( $actual );
$this->assertEqualSets( $expected, $actual );
$this->assertEquals( $expected, $actual );
// Clear customer cache.
$this->getModule('\Helper\Wpunit')->clear_loader_cache( 'wc_customer' );
@@ -108,7 +108,7 @@ class CustomerQueriesTest extends \Codeception\TestCase\WPTestCase {
// use --debug flag to view.
codecept_debug( $actual );
$this->assertEqualSets( $expected, $actual );
$this->assertEquals( $expected, $actual );
// Clear customer cache.
$this->getModule('\Helper\Wpunit')->clear_loader_cache( 'wc_customer' );
@@ -127,7 +127,7 @@ class CustomerQueriesTest extends \Codeception\TestCase\WPTestCase {
// use --debug flag to view.
codecept_debug( $actual );
$this->assertEqualSets( $expected['data'], $actual['data'] );
$this->assertEquals( $expected['data'], $actual['data'] );
$this->assertArrayHasKey('errors', $actual );
// Clear customer cache.
@@ -145,7 +145,7 @@ class CustomerQueriesTest extends \Codeception\TestCase\WPTestCase {
// use --debug flag to view.
codecept_debug( $actual );
$this->assertEqualSets( $expected, $actual );
$this->assertEquals( $expected, $actual );
}
public function testCustomerByQuery() {
@@ -215,7 +215,7 @@ class CustomerQueriesTest extends \Codeception\TestCase\WPTestCase {
// use --debug flag to view.
codecept_debug( $actual );
$this->assertEqualSets( $expected, $actual );
$this->assertEquals( $expected, $actual );
// Clear customer cache.
$this->getModule('\Helper\Wpunit')->clear_loader_cache( 'wc_customer' );
@@ -233,7 +233,7 @@ class CustomerQueriesTest extends \Codeception\TestCase\WPTestCase {
// use --debug flag to view.
codecept_debug( $actual );
$this->assertEqualSets( $expected, $actual );
$this->assertEquals( $expected, $actual );
}
public function testCustomersQueryAndWhereArgs() {
@@ -288,7 +288,7 @@ class CustomerQueriesTest extends \Codeception\TestCase\WPTestCase {
// use --debug flag to view.
codecept_debug( $actual );
$this->assertEqualSets( $expected, $actual );
$this->assertEquals( $expected, $actual );
// Clear customer cache.
$this->getModule('\Helper\Wpunit')->clear_loader_cache( 'wc_customer' );
@@ -311,7 +311,7 @@ class CustomerQueriesTest extends \Codeception\TestCase\WPTestCase {
// use --debug flag to view.
codecept_debug( $actual );
$this->assertEqualSets( $expected, $actual );
$this->assertEquals( $expected, $actual );
/**
* Assertion Three
@@ -339,7 +339,7 @@ class CustomerQueriesTest extends \Codeception\TestCase\WPTestCase {
// use --debug flag to view.
codecept_debug( $actual );
$this->assertEqualSets( $expected, $actual );
$this->assertEquals( $expected, $actual );
/**
* Assertion Four
@@ -366,7 +366,7 @@ class CustomerQueriesTest extends \Codeception\TestCase\WPTestCase {
// use --debug flag to view.
codecept_debug( $actual );
$this->assertEqualSets( $expected, $actual );
$this->assertEquals( $expected, $actual );
/**
* Assertion Five
@@ -393,7 +393,7 @@ class CustomerQueriesTest extends \Codeception\TestCase\WPTestCase {
// use --debug flag to view.
codecept_debug( $actual );
$this->assertEqualSets( $expected, $actual );
$this->assertEquals( $expected, $actual );
/**
* Assertion Six
@@ -421,7 +421,7 @@ class CustomerQueriesTest extends \Codeception\TestCase\WPTestCase {
// use --debug flag to view.
codecept_debug( $actual );
$this->assertEqualSets( $expected, $actual );
$this->assertEquals( $expected, $actual );
/**
* Assertion Seven
@@ -449,7 +449,7 @@ class CustomerQueriesTest extends \Codeception\TestCase\WPTestCase {
// use --debug flag to view.
codecept_debug( $actual );
$this->assertEqualSets( $expected, $actual );
$this->assertEquals( $expected, $actual );
/**
* Assertion Eight
@@ -477,7 +477,7 @@ class CustomerQueriesTest extends \Codeception\TestCase\WPTestCase {
// use --debug flag to view.
codecept_debug( $actual );
$this->assertEqualSets( $expected, $actual );
$this->assertEquals( $expected, $actual );
/**
* Assertion Nine
@@ -505,7 +505,7 @@ class CustomerQueriesTest extends \Codeception\TestCase\WPTestCase {
// use --debug flag to view.
codecept_debug( $actual );
$this->assertEqualSets( $expected, $actual );
$this->assertEquals( $expected, $actual );
/**
* Assertion Ten
@@ -539,6 +539,6 @@ class CustomerQueriesTest extends \Codeception\TestCase\WPTestCase {
// use --debug flag to view.
codecept_debug( $actual );
$this->assertEqualSets( $expected, $actual );
$this->assertEquals( $expected, $actual );
}
}
+14 -14
View File
@@ -135,7 +135,7 @@ class MetaDataQueriesTest extends \Codeception\TestCase\WPTestCase {
// use --debug flag to view.
codecept_debug( $actual );
$this->assertEqualSets( $expected, $actual );
$this->assertEquals( $expected, $actual );
/**
* Assertion Two
@@ -167,7 +167,7 @@ class MetaDataQueriesTest extends \Codeception\TestCase\WPTestCase {
// use --debug flag to view.
codecept_debug( $actual );
$this->assertEqualSets( $expected, $actual );
$this->assertEquals( $expected, $actual );
/**
* Assertion Three
@@ -199,7 +199,7 @@ class MetaDataQueriesTest extends \Codeception\TestCase\WPTestCase {
// use --debug flag to view.
codecept_debug( $actual );
$this->assertEqualSets( $expected, $actual );
$this->assertEquals( $expected, $actual );
}
public function testCouponMetaDataQueries() {
@@ -250,7 +250,7 @@ class MetaDataQueriesTest extends \Codeception\TestCase\WPTestCase {
// use --debug flag to view.
codecept_debug( $actual );
$this->assertEqualSets( $expected, $actual );
$this->assertEquals( $expected, $actual );
/**
* Assertion Two
@@ -276,7 +276,7 @@ class MetaDataQueriesTest extends \Codeception\TestCase\WPTestCase {
// use --debug flag to view.
codecept_debug( $actual );
$this->assertEqualSets( $expected, $actual );
$this->assertEquals( $expected, $actual );
/**
* Assertion Three
@@ -302,7 +302,7 @@ class MetaDataQueriesTest extends \Codeception\TestCase\WPTestCase {
// use --debug flag to view.
codecept_debug( $actual );
$this->assertEqualSets( $expected, $actual );
$this->assertEquals( $expected, $actual );
/**
* Assertion Four
@@ -332,7 +332,7 @@ class MetaDataQueriesTest extends \Codeception\TestCase\WPTestCase {
// use --debug flag to view.
codecept_debug( $actual );
$this->assertEqualSets( $expected, $actual );
$this->assertEquals( $expected, $actual );
/**
* Assertion Five
@@ -362,7 +362,7 @@ class MetaDataQueriesTest extends \Codeception\TestCase\WPTestCase {
// use --debug flag to view.
codecept_debug( $actual );
$this->assertEqualSets( $expected, $actual );
$this->assertEquals( $expected, $actual );
/**
* Assertion Six
@@ -396,7 +396,7 @@ class MetaDataQueriesTest extends \Codeception\TestCase\WPTestCase {
// use --debug flag to view.
codecept_debug( $actual );
$this->assertEqualSets( $expected, $actual );
$this->assertEquals( $expected, $actual );
}
public function testCustomerMetaDataQueries() {
@@ -438,7 +438,7 @@ class MetaDataQueriesTest extends \Codeception\TestCase\WPTestCase {
// use --debug flag to view.
codecept_debug( $actual );
$this->assertEqualSets( $expected, $actual );
$this->assertEquals( $expected, $actual );
}
public function testOrderMetaDataQueries() {
@@ -510,7 +510,7 @@ class MetaDataQueriesTest extends \Codeception\TestCase\WPTestCase {
// use --debug flag to view.
codecept_debug( $actual );
$this->assertEqualSets( $expected, $actual );
$this->assertEquals( $expected, $actual );
}
public function testProductMetaDataQueries() {
@@ -560,7 +560,7 @@ class MetaDataQueriesTest extends \Codeception\TestCase\WPTestCase {
// use --debug flag to view.
codecept_debug( $actual );
$this->assertEqualSets( $expected, $actual );
$this->assertEquals( $expected, $actual );
}
public function testProductVariationMetaDataQueries() {
@@ -608,7 +608,7 @@ class MetaDataQueriesTest extends \Codeception\TestCase\WPTestCase {
// use --debug flag to view.
codecept_debug( $actual );
$this->assertEqualSets( $expected, $actual );
$this->assertEquals( $expected, $actual );
}
public function testRefundMetaDataQueries() {
@@ -656,6 +656,6 @@ class MetaDataQueriesTest extends \Codeception\TestCase\WPTestCase {
// use --debug flag to view.
codecept_debug( $actual );
$this->assertEqualSets( $expected, $actual );
$this->assertEquals( $expected, $actual );
}
}
+1 -1
View File
@@ -450,7 +450,7 @@ class OrderMutationsTest extends \Codeception\TestCase\WPTestCase {
)
);
$this->assertEqualSets( $expected, $actual );
$this->assertEquals( $expected, $actual );
}
public function testUpdateOrderMutation() {
+5 -5
View File
@@ -120,7 +120,7 @@ class OrderQueriesTest extends \Codeception\TestCase\WPTestCase {
// use --debug flag to view.
codecept_debug( $actual );
$this->assertEqualSets( $expected, $actual );
$this->assertEquals( $expected, $actual );
// Clear loader cache.
$this->getModule('\Helper\Wpunit')->clear_loader_cache( 'wc_post_crud' );
@@ -138,7 +138,7 @@ class OrderQueriesTest extends \Codeception\TestCase\WPTestCase {
// use --debug flag to view.
codecept_debug( $actual );
$this->assertEqualSets( $expected, $actual );
$this->assertEquals( $expected, $actual );
}
public function testOrderByQueryAndArgs() {
@@ -164,7 +164,7 @@ class OrderQueriesTest extends \Codeception\TestCase\WPTestCase {
// use --debug flag to view.
codecept_debug( $actual );
$this->assertEqualSets( $expected, $actual );
$this->assertEquals( $expected, $actual );
/**
* Assertion Two
@@ -178,7 +178,7 @@ class OrderQueriesTest extends \Codeception\TestCase\WPTestCase {
// use --debug flag to view.
codecept_debug( $actual );
$this->assertEqualSets( $expected, $actual );
$this->assertEquals( $expected, $actual );
/**
* Assertion Three
@@ -192,7 +192,7 @@ class OrderQueriesTest extends \Codeception\TestCase\WPTestCase {
// use --debug flag to view.
codecept_debug( $actual );
$this->assertEqualSets( $expected, $actual );
$this->assertEquals( $expected, $actual );
}
public function testOrdersQueryAndWhereArgs() {
+3 -3
View File
@@ -67,7 +67,7 @@ class ProductAttributeQueriesTest extends \Codeception\TestCase\WPTestCase {
// use --debug flag to view.
codecept_debug( $actual );
$this->assertEqualSets( $expected, $actual );
$this->assertEquals( $expected, $actual );
}
public function testProductAttributeToProductConnectionQuery() {
@@ -116,7 +116,7 @@ class ProductAttributeQueriesTest extends \Codeception\TestCase\WPTestCase {
// use --debug flag to view.
codecept_debug( $actual );
$this->assertEqualSets( $expected, $actual );
$this->assertEquals( $expected, $actual );
}
public function testProductAttributeToVariationConnectionQuery() {
@@ -173,6 +173,6 @@ class ProductAttributeQueriesTest extends \Codeception\TestCase\WPTestCase {
// use --debug flag to view.
codecept_debug( $actual );
$this->assertEqualSets( $expected, $actual );
$this->assertEquals( $expected, $actual );
}
}
+5 -5
View File
@@ -127,7 +127,7 @@ class ProductQueriesTest extends \Codeception\TestCase\WPTestCase {
// use --debug flag to view.
codecept_debug( $actual );
$this->assertEqualSets( $expected, $actual );
$this->assertEquals( $expected, $actual );
// Clear cache
$this->getModule('\Helper\Wpunit')->clear_loader_cache( 'wc_post_crud' );
@@ -156,7 +156,7 @@ class ProductQueriesTest extends \Codeception\TestCase\WPTestCase {
// use --debug flag to view.
codecept_debug( $actual );
$this->assertEqualSets( $expected, $actual );
$this->assertEquals( $expected, $actual );
}
public function testProductTaxonomies() {
@@ -1068,7 +1068,7 @@ class ProductQueriesTest extends \Codeception\TestCase\WPTestCase {
// use --debug flag to view.
codecept_debug( $actual );
$this->assertEqualSets( $expected, $actual );
$this->assertEquals( $expected, $actual );
}
public function testGroupProductConnections() {
@@ -1107,7 +1107,7 @@ class ProductQueriesTest extends \Codeception\TestCase\WPTestCase {
// use --debug flag to view.
codecept_debug( $actual );
$this->assertEqualSets( $expected, $actual );
$this->assertEquals( $expected, $actual );
}
public function testRelatedProductConnections() {
@@ -1161,6 +1161,6 @@ class ProductQueriesTest extends \Codeception\TestCase\WPTestCase {
// use --debug flag to view.
codecept_debug( $actual );
$this->assertEqualSets( $expected, $actual );
$this->assertEquals( $expected, $actual );
}
}
+4 -4
View File
@@ -86,7 +86,7 @@ class ProductVariationQueriesTest extends \Codeception\TestCase\WPTestCase {
// use --debug flag to view.
codecept_debug( $actual );
$this->assertEqualSets( $expected, $actual );
$this->assertEquals( $expected, $actual );
$this->getModule('\Helper\Wpunit')->clear_loader_cache( 'wc_post_crud' );
@@ -102,7 +102,7 @@ class ProductVariationQueriesTest extends \Codeception\TestCase\WPTestCase {
// use --debug flag to view.
codecept_debug( $actual );
$this->assertEqualSets( $expected, $actual );
$this->assertEquals( $expected, $actual );
}
public function testVariationsQueryAndWhereArgs() {
@@ -173,7 +173,7 @@ class ProductVariationQueriesTest extends \Codeception\TestCase\WPTestCase {
// use --debug flag to view.
codecept_debug( $actual );
$this->assertEqualSets( $expected, $actual );
$this->assertEquals( $expected, $actual );
/**
* Assertion Two
@@ -206,7 +206,7 @@ class ProductVariationQueriesTest extends \Codeception\TestCase\WPTestCase {
// use --debug flag to view.
codecept_debug( $actual );
$this->assertEqualSets( $expected, $actual );
$this->assertEquals( $expected, $actual );
}
public function testProductVariationToMediaItemConnections() {
+5 -5
View File
@@ -110,7 +110,7 @@ class RefundQueriesTest extends \Codeception\TestCase\WPTestCase {
// use --debug flag to view.
codecept_debug( $actual );
$this->assertEqualSets( $expected, $actual );
$this->assertEquals( $expected, $actual );
/**
* Assertion Two
@@ -160,7 +160,7 @@ class RefundQueriesTest extends \Codeception\TestCase\WPTestCase {
// use --debug flag to view.
codecept_debug( $actual );
$this->assertEqualSets( $expected, $actual );
$this->assertEquals( $expected, $actual );
/**
* Assertion Two
@@ -180,7 +180,7 @@ class RefundQueriesTest extends \Codeception\TestCase\WPTestCase {
// use --debug flag to view.
codecept_debug( $actual );
$this->assertEqualSets( $expected, $actual );
$this->assertEquals( $expected, $actual );
/**
* Assertion Three
@@ -209,7 +209,7 @@ class RefundQueriesTest extends \Codeception\TestCase\WPTestCase {
// use --debug flag to view.
codecept_debug( $actual );
$this->assertEqualSets( $expected, $actual );
$this->assertEquals( $expected, $actual );
/**
* Assertion Four
@@ -237,6 +237,6 @@ class RefundQueriesTest extends \Codeception\TestCase\WPTestCase {
// use --debug flag to view.
codecept_debug( $actual );
$this->assertEqualSets( $expected, $actual );
$this->assertEquals( $expected, $actual );
}
}
+3 -3
View File
@@ -50,7 +50,7 @@ class ShippingMethodQueriesTest extends \Codeception\TestCase\WPTestCase {
// use --debug flag to view.
codecept_debug( $actual );
$this->assertEqualSets( $expected, $actual );
$this->assertEquals( $expected, $actual );
/**
* Assertion Two
@@ -64,7 +64,7 @@ class ShippingMethodQueriesTest extends \Codeception\TestCase\WPTestCase {
// use --debug flag to view.
codecept_debug( $actual );
$this->assertEqualSets( $expected, $actual );
$this->assertEquals( $expected, $actual );
}
@@ -100,6 +100,6 @@ class ShippingMethodQueriesTest extends \Codeception\TestCase\WPTestCase {
// use --debug flag to view.
codecept_debug( $actual );
$this->assertEqualSets( $expected, $actual );
$this->assertEquals( $expected, $actual );
}
}
+4 -4
View File
@@ -59,7 +59,7 @@ class TaxRateQueriesTest extends \Codeception\TestCase\WPTestCase {
// use --debug flag to view.
codecept_debug( $actual );
$this->assertEqualSets( $expected, $actual );
$this->assertEquals( $expected, $actual );
/**
* Assertion Two
@@ -73,7 +73,7 @@ class TaxRateQueriesTest extends \Codeception\TestCase\WPTestCase {
// use --debug flag to view.
codecept_debug( $actual );
$this->assertEqualSets( $expected, $actual );
$this->assertEquals( $expected, $actual );
}
public function testTaxesQuery() {
@@ -127,7 +127,7 @@ class TaxRateQueriesTest extends \Codeception\TestCase\WPTestCase {
// use --debug flag to view.
codecept_debug( $actual );
$this->assertEqualSets( $expected, $actual );
$this->assertEquals( $expected, $actual );
/**
* Assertion Two
@@ -160,6 +160,6 @@ class TaxRateQueriesTest extends \Codeception\TestCase\WPTestCase {
// use --debug flag to view.
codecept_debug( $actual );
$this->assertEqualSets( $expected, $actual );
$this->assertEquals( $expected, $actual );
}
}
@@ -63,7 +63,7 @@ class VariationAttributeQueriesTest extends \Codeception\TestCase\WPTestCase {
// use --debug flag to view.
codecept_debug( $actual );
$this->assertEqualSets( $expected, $actual );
$this->assertEquals( $expected, $actual );
}
public function testProductToVariationAttributeQuery() {
@@ -104,7 +104,7 @@ class VariationAttributeQueriesTest extends \Codeception\TestCase\WPTestCase {
// use --debug flag to view.
codecept_debug( $actual );
$this->assertEqualSets( $expected, $actual );
$this->assertEquals( $expected, $actual );
}
}
+1 -1
View File
@@ -4,4 +4,4 @@
require_once __DIR__ . '/composer/autoload_real.php';
return ComposerAutoloaderInit71eeabde6fbf0f089c103ca7b0ed7868::getLoader();
return ComposerAutoloaderInitcece0dfed0b70a4b4547c45015505517::getLoader();
+1
View File
@@ -7,4 +7,5 @@ $baseDir = dirname($vendorDir);
return array(
'914b07b8cf678ed0b81bfdb5d23b4f2b' => $baseDir . '/includes/connection/common-post-type-args.php',
'45a15019e901000ab8608c03ebff44fb' => $baseDir . '/includes/functions.php',
);
+7 -7
View File
@@ -2,7 +2,7 @@
// autoload_real.php @generated by Composer
class ComposerAutoloaderInit71eeabde6fbf0f089c103ca7b0ed7868
class ComposerAutoloaderInitcece0dfed0b70a4b4547c45015505517
{
private static $loader;
@@ -19,15 +19,15 @@ class ComposerAutoloaderInit71eeabde6fbf0f089c103ca7b0ed7868
return self::$loader;
}
spl_autoload_register(array('ComposerAutoloaderInit71eeabde6fbf0f089c103ca7b0ed7868', 'loadClassLoader'), true, true);
spl_autoload_register(array('ComposerAutoloaderInitcece0dfed0b70a4b4547c45015505517', 'loadClassLoader'), true, true);
self::$loader = $loader = new \Composer\Autoload\ClassLoader();
spl_autoload_unregister(array('ComposerAutoloaderInit71eeabde6fbf0f089c103ca7b0ed7868', 'loadClassLoader'));
spl_autoload_unregister(array('ComposerAutoloaderInitcece0dfed0b70a4b4547c45015505517', 'loadClassLoader'));
$useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
if ($useStaticLoader) {
require_once __DIR__ . '/autoload_static.php';
call_user_func(\Composer\Autoload\ComposerStaticInit71eeabde6fbf0f089c103ca7b0ed7868::getInitializer($loader));
call_user_func(\Composer\Autoload\ComposerStaticInitcece0dfed0b70a4b4547c45015505517::getInitializer($loader));
} else {
$map = require __DIR__ . '/autoload_namespaces.php';
foreach ($map as $namespace => $path) {
@@ -48,19 +48,19 @@ class ComposerAutoloaderInit71eeabde6fbf0f089c103ca7b0ed7868
$loader->register(true);
if ($useStaticLoader) {
$includeFiles = Composer\Autoload\ComposerStaticInit71eeabde6fbf0f089c103ca7b0ed7868::$files;
$includeFiles = Composer\Autoload\ComposerStaticInitcece0dfed0b70a4b4547c45015505517::$files;
} else {
$includeFiles = require __DIR__ . '/autoload_files.php';
}
foreach ($includeFiles as $fileIdentifier => $file) {
composerRequire71eeabde6fbf0f089c103ca7b0ed7868($fileIdentifier, $file);
composerRequirecece0dfed0b70a4b4547c45015505517($fileIdentifier, $file);
}
return $loader;
}
}
function composerRequire71eeabde6fbf0f089c103ca7b0ed7868($fileIdentifier, $file)
function composerRequirecece0dfed0b70a4b4547c45015505517($fileIdentifier, $file)
{
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
require $file;
+5 -4
View File
@@ -4,10 +4,11 @@
namespace Composer\Autoload;
class ComposerStaticInit71eeabde6fbf0f089c103ca7b0ed7868
class ComposerStaticInitcece0dfed0b70a4b4547c45015505517
{
public static $files = array (
'914b07b8cf678ed0b81bfdb5d23b4f2b' => __DIR__ . '/../..' . '/includes/connection/common-post-type-args.php',
'45a15019e901000ab8608c03ebff44fb' => __DIR__ . '/../..' . '/includes/functions.php',
);
public static $prefixLengthsPsr4 = array (
@@ -147,9 +148,9 @@ class ComposerStaticInit71eeabde6fbf0f089c103ca7b0ed7868
public static function getInitializer(ClassLoader $loader)
{
return \Closure::bind(function () use ($loader) {
$loader->prefixLengthsPsr4 = ComposerStaticInit71eeabde6fbf0f089c103ca7b0ed7868::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInit71eeabde6fbf0f089c103ca7b0ed7868::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInit71eeabde6fbf0f089c103ca7b0ed7868::$classMap;
$loader->prefixLengthsPsr4 = ComposerStaticInitcece0dfed0b70a4b4547c45015505517::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInitcece0dfed0b70a4b4547c45015505517::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInitcece0dfed0b70a4b4547c45015505517::$classMap;
}, null, ClassLoader::class);
}
+3 -1
View File
@@ -3,13 +3,15 @@
* Plugin Name: WP GraphQL WooCommerce
* Plugin URI: https://github.com/kidunot89/wp-graphql-woocommerce
* Description: Adds Woocommerce Functionality to WPGraphQL schema.
* Version: 0.3.0
* Version: 0.3.1
* Author: kidunot89
* Author URI: https://axistaylor.com
* Text Domain: wp-graphql-woocommerce
* Domain Path: /languages
* License: GPL-3
* License URI: https://www.gnu.org/licenses/gpl-3.0.html
* WC requires at least: 3.0.0
* WC tested up to: 3.7.1
*
* @package WPGraphQL\WooCommerce
* @author kidunot89