From cf2535398560da32a59fe311c96db8604d635376 Mon Sep 17 00:00:00 2001 From: Geoff Taylor Date: Mon, 6 Jul 2020 16:33:48 -0400 Subject: [PATCH] ProductAttributeQueriesTest updated --- tests/_support/Helper/crud-helpers/product.php | 14 +++++++------- tests/wpunit/ProductAttributeQueriesTest.php | 8 ++++---- vendor/composer/ClassLoader.php | 2 +- vendor/composer/autoload_classmap.php | 5 +++++ vendor/composer/autoload_psr4.php | 1 + vendor/composer/autoload_real.php | 3 +++ vendor/composer/autoload_static.php | 13 +++++++++++++ 7 files changed, 34 insertions(+), 12 deletions(-) diff --git a/tests/_support/Helper/crud-helpers/product.php b/tests/_support/Helper/crud-helpers/product.php index 3ddbdca7..0407ad14 100644 --- a/tests/_support/Helper/crud-helpers/product.php +++ b/tests/_support/Helper/crud-helpers/product.php @@ -192,7 +192,7 @@ class ProductHelper extends WCG_Helper { $this->create_simple(), $this->create_simple(), ); - $tag_ids = array( $this->create_product_tag( 'related' ) ); + $tag_ids = array( $this->create_product_tag( 'related' ) ); $related_product_id = $this->create_simple( array( 'tag_ids' => $tag_ids ) ); return array( @@ -389,7 +389,7 @@ class ProductHelper extends WCG_Helper { $results[] = array( 'id' => base64_encode( $attribute_name . ':' . $id . ':' . $attribute->get_name() ), 'attributeId' => $attribute->get_id(), - 'name' => $attribute->get_name(), + 'name' => str_replace( 'pa_', '', $attribute->get_name() ), 'options' => $attribute->get_slugs(), 'position' => $attribute->get_position(), 'visible' => $attribute->get_visible(), @@ -406,7 +406,7 @@ class ProductHelper extends WCG_Helper { if ( empty( $downloads ) ) { return null; } - + $results = array(); foreach ( $downloads as $download ) { $results[] = array( @@ -420,7 +420,7 @@ class ProductHelper extends WCG_Helper { 'file' => $download->get_file(), ); } - + return $results; } @@ -493,13 +493,13 @@ class ProductHelper extends WCG_Helper { $reviews = array(); foreach ( $ids as $review_id ) { $reviews[] = array( - 'rating' => floatval( get_comment_meta( $review_id, 'rating', true ) ), + 'rating' => floatval( get_comment_meta( $review_id, 'rating', true ) ), 'node' => array( 'id' => Relay::toGlobalId( 'comment', $review_id ) ), ); } - + return $reviews; } -} \ No newline at end of file +} diff --git a/tests/wpunit/ProductAttributeQueriesTest.php b/tests/wpunit/ProductAttributeQueriesTest.php index d4fe8e4b..c1f3528d 100644 --- a/tests/wpunit/ProductAttributeQueriesTest.php +++ b/tests/wpunit/ProductAttributeQueriesTest.php @@ -14,10 +14,10 @@ class ProductAttributeQueriesTest extends \Codeception\TestCase\WPTestCase { $this->shop_manager = $this->factory->user->create( array( 'role' => 'shop_manager' ) ); $this->customer = $this->factory->user->create( array( 'role' => 'customer' ) ); $this->helper = $this->getModule('\Helper\Wpunit')->product(); - $this->variation_helper = $this->getModule('\Helper\Wpunit')->product_variation(); + $this->variation_helper = $this->getModule('\Helper\Wpunit')->product_variation(); $this->product_id = $this->helper->create_variable(); $this->variation_ids = $this->variation_helper->create( $this->product_id )['variations']; - + } public function tearDown() { @@ -35,7 +35,7 @@ class ProductAttributeQueriesTest extends \Codeception\TestCase\WPTestCase { nodes { id attributeId - name + name options position visible @@ -175,4 +175,4 @@ class ProductAttributeQueriesTest extends \Codeception\TestCase\WPTestCase { $this->assertEquals( $expected, $actual ); } -} \ No newline at end of file +} diff --git a/vendor/composer/ClassLoader.php b/vendor/composer/ClassLoader.php index 95f7e097..fce8549f 100644 --- a/vendor/composer/ClassLoader.php +++ b/vendor/composer/ClassLoader.php @@ -279,7 +279,7 @@ class ClassLoader */ public function setApcuPrefix($apcuPrefix) { - $this->apcuPrefix = function_exists('apcu_fetch') && ini_get('apc.enabled') ? $apcuPrefix : null; + $this->apcuPrefix = function_exists('apcu_fetch') && filter_var(ini_get('apc.enabled'), FILTER_VALIDATE_BOOLEAN) ? $apcuPrefix : null; } /** diff --git a/vendor/composer/autoload_classmap.php b/vendor/composer/autoload_classmap.php index fea85425..70039436 100644 --- a/vendor/composer/autoload_classmap.php +++ b/vendor/composer/autoload_classmap.php @@ -6,6 +6,11 @@ $vendorDir = dirname(dirname(__FILE__)); $baseDir = dirname($vendorDir); return array( + 'Firebase\\JWT\\BeforeValidException' => $vendorDir . '/firebase/php-jwt/src/BeforeValidException.php', + 'Firebase\\JWT\\ExpiredException' => $vendorDir . '/firebase/php-jwt/src/ExpiredException.php', + 'Firebase\\JWT\\JWK' => $vendorDir . '/firebase/php-jwt/src/JWK.php', + 'Firebase\\JWT\\JWT' => $vendorDir . '/firebase/php-jwt/src/JWT.php', + 'Firebase\\JWT\\SignatureInvalidException' => $vendorDir . '/firebase/php-jwt/src/SignatureInvalidException.php', 'WPGraphQL\\WooCommerce\\ACF_Schema_Filters' => $baseDir . '/includes/class-acf-schema-filters.php', 'WPGraphQL\\WooCommerce\\Connection\\Cart_Items' => $baseDir . '/includes/connection/class-cart-items.php', 'WPGraphQL\\WooCommerce\\Connection\\Coupons' => $baseDir . '/includes/connection/class-coupons.php', diff --git a/vendor/composer/autoload_psr4.php b/vendor/composer/autoload_psr4.php index 326ce2a4..c4d53691 100644 --- a/vendor/composer/autoload_psr4.php +++ b/vendor/composer/autoload_psr4.php @@ -7,4 +7,5 @@ $baseDir = dirname($vendorDir); return array( 'WPGraphQL\\WooCommerce\\' => array($baseDir . '/includes'), + 'Firebase\\JWT\\' => array($vendorDir . '/firebase/php-jwt/src'), ); diff --git a/vendor/composer/autoload_real.php b/vendor/composer/autoload_real.php index 578aedce..a7f1a09a 100644 --- a/vendor/composer/autoload_real.php +++ b/vendor/composer/autoload_real.php @@ -13,6 +13,9 @@ class ComposerAutoloaderInit51f6ef77ec7a78ec4a9df8dd9f5dc45f } } + /** + * @return \Composer\Autoload\ClassLoader + */ public static function getLoader() { if (null !== self::$loader) { diff --git a/vendor/composer/autoload_static.php b/vendor/composer/autoload_static.php index 6df8de51..4b8aa030 100644 --- a/vendor/composer/autoload_static.php +++ b/vendor/composer/autoload_static.php @@ -16,6 +16,10 @@ class ComposerStaticInit51f6ef77ec7a78ec4a9df8dd9f5dc45f array ( 'WPGraphQL\\WooCommerce\\' => 22, ), + 'F' => + array ( + 'Firebase\\JWT\\' => 13, + ), ); public static $prefixDirsPsr4 = array ( @@ -23,9 +27,18 @@ class ComposerStaticInit51f6ef77ec7a78ec4a9df8dd9f5dc45f array ( 0 => __DIR__ . '/../..' . '/includes', ), + 'Firebase\\JWT\\' => + array ( + 0 => __DIR__ . '/..' . '/firebase/php-jwt/src', + ), ); public static $classMap = array ( + 'Firebase\\JWT\\BeforeValidException' => __DIR__ . '/..' . '/firebase/php-jwt/src/BeforeValidException.php', + 'Firebase\\JWT\\ExpiredException' => __DIR__ . '/..' . '/firebase/php-jwt/src/ExpiredException.php', + 'Firebase\\JWT\\JWK' => __DIR__ . '/..' . '/firebase/php-jwt/src/JWK.php', + 'Firebase\\JWT\\JWT' => __DIR__ . '/..' . '/firebase/php-jwt/src/JWT.php', + 'Firebase\\JWT\\SignatureInvalidException' => __DIR__ . '/..' . '/firebase/php-jwt/src/SignatureInvalidException.php', 'WPGraphQL\\WooCommerce\\ACF_Schema_Filters' => __DIR__ . '/../..' . '/includes/class-acf-schema-filters.php', 'WPGraphQL\\WooCommerce\\Connection\\Cart_Items' => __DIR__ . '/../..' . '/includes/connection/class-cart-items.php', 'WPGraphQL\\WooCommerce\\Connection\\Coupons' => __DIR__ . '/../..' . '/includes/connection/class-coupons.php',