From 1e63b7bf2a1f67c9a83f00ad1d373d0a0064d770 Mon Sep 17 00:00:00 2001 From: Geoff Taylor Date: Wed, 23 Jan 2019 01:12:12 -0500 Subject: [PATCH 1/7] settings-patch.php implemented. PatchSettingsTest added. --- settings-patch.php | 268 ++++++++++++++++++ tests/wpunit/PatchSettingsTest.php | 185 ++++++++++++ vendor/autoload.php | 2 +- vendor/composer/ClassLoader.php | 2 +- vendor/composer/LICENSE | 2 + .../composer/autoload_commands_classmap.php | 9 - vendor/composer/autoload_commands_real.php | 34 --- .../composer/autoload_framework_classmap.php | 248 ---------------- vendor/composer/autoload_framework_real.php | 34 --- vendor/composer/autoload_real.php | 8 +- vendor/composer/autoload_static.php | 8 +- wp-graphql.php | 7 + 12 files changed, 472 insertions(+), 335 deletions(-) create mode 100644 settings-patch.php create mode 100644 tests/wpunit/PatchSettingsTest.php delete mode 100644 vendor/composer/autoload_commands_classmap.php delete mode 100644 vendor/composer/autoload_commands_real.php delete mode 100644 vendor/composer/autoload_framework_classmap.php delete mode 100644 vendor/composer/autoload_framework_real.php diff --git a/settings-patch.php b/settings-patch.php new file mode 100644 index 000000000..2a7452db6 --- /dev/null +++ b/settings-patch.php @@ -0,0 +1,268 @@ + array( + 'default_pingback_flag' => array( + 'show_in_rest' => true, + 'type' => 'boolean', + 'description' => __( 'Attempt to notify any blogs linked to from the article', 'wp-graphql' ) + ), + 'comments_notify' => array( + 'show_in_rest' => true, + 'type' => 'boolean', + 'description' => __( 'Anyone posts a comment', 'wp-graphql' ) + ), + 'moderation_notify' => array( + 'show_in_rest' => true, + 'type' => 'boolean', + 'description' => __( 'A comment is held for moderation', 'wp-graphql' ) + ), + 'comment_moderation' => array( + 'show_in_rest' => true, + 'type' => 'boolean', + 'description' => __( 'Comment must be manually approved', 'wp-graphql' ) + ), + 'require_name_email' => array( + 'show_in_rest' => true, + 'type' => 'boolean', + 'description' => __( 'Comment author must fill out name and email', 'wp-graphql' ) + ), + 'comment_whitelist' => array( + 'show_in_rest' => true, + 'type' => 'boolean', + 'description' => __( 'Comment author must have a previously approved comment', 'wp-graphql' ) + ), + 'comment_max_links' => array( + 'show_in_rest' => true, + 'type' => 'integer', + 'description' => __( 'The number of links necessary for a comment to be queued. (For protection against spam comments)', 'wp-graphql' ) + ), + 'moderation_keys' => array( + 'show_in_rest' => true, + 'type' => 'string', + 'description' => __( 'When a comment contains any of these words in its content, name, URL, email, or IP address, it will be held in the moderation queue. One word or IP address per line. It will match inside words, so “press” will match “WordPress”.', 'wp-graphql' ) + ), + 'blacklist_keys' => array( + 'show_in_rest' => true, + 'type' => 'string', + 'description' => __( 'When a comment contains any of these words in its content, name, URL, email, or IP address, it will be put in the trash. One word or IP address per line. It will match inside words, so “press” will match “WordPress”.', 'wp-graphql' ) + ), + 'show_avatars' => array( + 'show_in_rest' => true, + 'type' => 'boolean', + 'description' => __( 'Show Avatars', 'wp-graphql' ) + ), + 'avatar_rating' => array( + 'show_in_rest' => array( + 'schema' => array( + 'enum' => array( 'G', 'PG', 'R', 'X' ), + ), + ), + 'type' => 'string', + 'description' => __( 'Avatar content rating', 'wp-graphql' ) + ), + 'avatar_default' => array( + 'show_in_rest' => array( + 'schema' => array( + 'enum' => array( + 'mystery', + 'blank', + 'gravatar_default', + 'identicon', + 'wavatar', + 'monsterid', + 'retro' + ), + ), + ), + 'type' => 'string', + 'description' => __( 'For users without a custom avatar of their own, you can either display a generic logo or a generated one based on their email address', 'wp-graphql' ) + ), + 'close_comments_for_old_posts' => array( + 'show_in_rest' => true, + 'type' => 'boolean', + 'description' => __( 'Automatically close comments on articles older than a number of days', 'wp-graphql' ) + ), + 'close_comments_days_old' => array( + 'show_in_rest' => true, + 'type' => 'integer', + 'description' => __( 'The number of days required for automatically closing the comments on an article', 'wp-graphql' ) + ), + 'thread_comments' => array( + 'show_in_rest' => true, + 'type' => 'boolean', + 'description' => __( 'Enable threaded (nested) comments', 'wp-graphql' ) + ), + 'thread_comments_depth' => array( + 'show_in_rest' => true, + 'type' => 'integer', + 'description' => __( 'Maximum level of comment thread depth', 'wp-graphql' ) + ), + 'page_comments' => array( + 'show_in_rest' => true, + 'type' => 'boolean', + 'description' => __( 'Break comments into pages', 'wp-graphql' ) + ), + 'comments_per_page' => array( + 'show_in_rest' => true, + 'type' => 'integer', + 'description' => __( 'Number of top level comments per page', 'wp-graphql' ) + ), + 'default_comments_page' => array( + 'show_in_rest' => array( + 'schema' => array( + 'enum' => array( 'newest', 'oldest' ), + ), + ), + 'type' => 'string', + 'description' => __( 'Comment page displayed by default', 'wp-graphql' ) + ), + 'comment_order' => array( + 'show_in_rest' => array( + 'schema' => array( + 'enum' => array( 'asc', 'desc' ), + ), + ), + 'type' => 'string', + 'description' => __( 'Order comments are displayed in', 'wp-graphql' ) + ), + 'comment_registration' => array( + 'show_in_rest' => true, + 'type' => 'boolean', + 'description' => __( 'Users must be registered and logged in to comment', 'wp-graphql' ) + ), + 'show_comments_cookies_opt_in' => array( + 'show_in_rest' => true, + 'type' => 'boolean', + 'description' => __( 'Show comments cookies opt-in checkbox', 'wp-graphql' ) + ), + ), + 'media' => array( + 'thumbnail_size_w' => array( + 'show_in_rest' => true, + 'type' => 'integer', + 'description' => __( 'Maximum width for thumbnail-sized content in pixels to use when adding an image to the Media Library', 'wp-graphql' ) + ), + 'thumbnail_size_h' => array( + 'show_in_rest' => true, + 'type' => 'integer', + 'description' => __( 'Maximum height for thumbnail-sized content in pixels to use when adding an image to the Media Library', 'wp-graphql' ) + ), + 'thumbnail_crop' => array( + 'show_in_rest' => true, + 'type' => 'boolean', + 'description' => __( 'Crop thumbnail to exact dimensions (normally thumbnails are proportional)', 'wp-graphql' ) + ), + 'medium_size_w' => array( + 'show_in_rest' => true, + 'type' => 'integer', + 'description' => __( 'Maximum width for medium-sized content in pixels to use when adding an image to the Media Library', 'wp-graphql' ) + ), + 'medium_size_h' => array( + 'show_in_rest' => true, + 'type' => 'integer', + 'description' => __( 'Maximum height for medium-sized content in pixels to use when adding an image to the Media Library', 'wp-graphql' ) + ), + 'large_size_w' => array( + 'show_in_rest' => true, + 'type' => 'integer', + 'description' => __( 'Maximum width for large-sized content in pixels to use when adding an image to the Media Library', 'wp-graphql' ) + ), + 'large_size_h' => array( + 'show_in_rest' => true, + 'type' => 'integer', + 'description' => __( 'Maximum height for large-sized content in pixels to use when adding an image to the Media Library', 'wp-graphql' ) + ), + /** + * TODO: Get more info on these three options + */ + // 'image_default_size' => array( + // 'show_in_rest', + // 'type', + // 'description' + // ), + // 'image_default_align' => array( + // 'show_in_rest', + // 'type', + // 'description' + // ), + // 'image_default_link_type' => array( + // 'show_in_rest', + // 'type', + // 'description' + // ), + 'uploads_use_yearmonth_folders' => array( + 'show_in_rest' => true, + 'type' => 'boolean', + 'description' => __( 'Organize my uploads into month- and year-based folders', 'wp-graphql' ) + ) + ), + 'reading' => array( + 'posts_per_rss' => array( + 'show_in_rest' => true, + 'type' => 'integer', + 'description' => __( 'Number of most recent syndication feeds shown per page', 'wp-graphql' ) + ), + 'rss_use_excerpt' => array( + 'show_in_rest' => array( + 'schema' => array( + 'enum' => array( '0', '1' ), + ), + ), + 'type' => 'string', + 'description' => __( 'For each article in a feed, show "full text (0)" or "summary (1)"', 'wp-graphql' ) + ), + 'show_on_front' => array( + 'show_in_rest' => array( + 'schema' => array( + 'enum' => array( 'posts', 'page' ), + ), + ), + 'type' => 'string', + 'description' => __( 'Your homepage displays', 'wp-graphql' ) + ), + 'page_on_front' => array( + 'show_in_rest' => true, + 'type' => 'string', + 'description' => __( 'WP Page ID of homepage', 'wp-graphql' ) + ), + 'page_for_posts' => array( + 'show_in_rest' => true, + 'type' => 'string', + 'description' => __( 'WP Page ID of blog page', 'wp-graphql' ) + ), + 'blog_public' => array( + 'show_in_rest' => true, + 'type' => 'boolean', + 'description' => __( 'Discourage search engines from indexing this site', 'wp-graphql' ) + ), + ), + 'writing' => array( + 'default_email_category' => array( + 'show_in_rest' => true, + 'type' => 'integer', + 'description' => __( 'WP ID of default mail category', 'wp-graphql' ) + ), + 'default_link_category' => array( + 'show_in_rest' => true, + 'type' => 'integer', + 'description' => __( 'WP ID of default link category', 'wp-graphql' ) + ), + ), + ); + + /** + * Loop through settings. + */ + foreach( $whitelist_options as $group_name => $group_settings ) { + foreach( $group_settings as $setting_name => $setting_args ) { + register_setting( $group_name, $setting_name, $setting_args ); + } + } + + } + + add_action( 'graphql_init', 'patch_whitelist_options', 1 ); \ No newline at end of file diff --git a/tests/wpunit/PatchSettingsTest.php b/tests/wpunit/PatchSettingsTest.php new file mode 100644 index 000000000..f661cf5ee --- /dev/null +++ b/tests/wpunit/PatchSettingsTest.php @@ -0,0 +1,185 @@ + 1, + 'default_comment_status' => 'open', + 'comments_notify' => 1, + 'moderation_notify' => 1, + 'comment_moderation' => null, + 'require_name_email' => 1, + 'comment_whitelist' => 1, + 'comment_max_links' => 2, + 'moderation_keys' => null, + 'blacklist_keys' => null, + 'show_avatars' => 1, + 'avatar_rating' => 'G', + 'avatar_default' => 'mystery', + 'close_comments_for_old_posts' => null, + 'close_comments_days_old' => 14, + 'thread_comments' => 1, + 'thread_comments_depth' => 5, + 'page_comments' => null, + 'default_comments_page' => 'newest', + 'comment_order' => 'asc', + 'comment_registration' => null, + 'show_comments_cookies_opt_in' => null, + 'thumbnail_size_w' => 150, + 'thumbnail_size_h' => 150, + 'thumbnail_crop' => 1, + 'medium_size_w' => 300, + 'medium_size_h' => 300, + 'large_size_w' => 1024, + 'large_size_h' => 1024, + 'posts_per_rss' => 10, + 'rss_use_excerpt' => null, + 'show_on_front' => 'posts', + 'page_on_front' => null, + 'page_for_posts' => null, + 'blog_public' => 1, + 'default_email_category' => 1, + 'default_link_category' => 2, + ]; + + foreach ( $mock_options as $mock_option_key => $mock_value ) { + update_option( $mock_option_key, $mock_value ); + } + + $query = " + query { + discussionSettings{ + defaultPingbackFlag + defaultCommentStatus + commentsNotify + moderationNotify + commentModeration + requireNameEmail + commentWhitelist + commentMaxLinks + moderationKeys + blacklistKeys + showAvatars + avatarRating + avatarDefault + closeCommentsForOldPosts + closeCommentsDaysOld + threadComments + threadCommentsDepth + pageComments + defaultCommentsPage + commentOrder + commentRegistration + showCommentsCookiesOptIn + } + mediaSettings { + thumbnailSizeW, + thumbnailSizeH, + thumbnailCrop + mediumSizeW + mediumSizeH + largeSizeW + largeSizeH + } + readingSettings { + postsPerRss + rssUseExcerpt + showOnFront + pageOnFront + pageForPosts + blogPublic + } + writingSettings { + defaultEmailCategory + defaultLinkCategory + } + + } + "; + $actual = do_graphql_request( $query ); + + $expected = array( + 'data' => array( + 'discussionSettings' => array( + 'defaultPingbackFlag' => 1, + 'defaultCommentStatus' => 'open', + 'commentsNotify' => 1, + 'moderationNotify' => 1, + 'commentModeration' => null, + 'requireNameEmail' => 1, + 'commentWhitelist' => 1, + 'commentMaxLinks' => 2, + 'moderationKeys' => null, + 'blacklistKeys' => null, + 'showAvatars' => 1, + 'avatarRating' => 'G', + 'avatarDefault' => 'mystery', + 'closeCommentsForOldPosts' => null, + 'closeCommentsDaysOld' => 14, + 'threadComments' => 1, + 'threadCommentsDepth' => 5, + 'pageComments' => null, + 'defaultCommentsPage' => 'newest', + 'commentOrder' => 'asc', + 'commentRegistration' => null, + 'showCommentsCookiesOptIn' => null, + ), + + 'mediaSettings' => array( + 'thumbnailSizeW' => 150, + 'thumbnailSizeH' => 150, + 'thumbnailCrop' => 1, + 'mediumSizeW' => 300, + 'mediumSizeH' => 300, + 'largeSizeW' => 1024, + 'largeSizeH' => 1024, + ), + + 'readingSettings' => array( + 'postsPerRss' => 10, + 'rssUseExcerpt' => null, + 'showOnFront' => 'posts', + 'pageOnFront' => null, + 'pageForPosts' => null, + 'blogPublic' => 1, + ), + + 'writingSettings' => array( + 'defaultEmailCategory' => 1, + 'defaultLinkCategory' => 2, + ) + ) + ); + + /** + * use --debug flag to view + */ + \Codeception\Util\Debug::debug( $actual ); + + /** + * Compare the actual output vs the expected output + */ + $this->assertEquals( $actual, $expected ); + } + +} \ No newline at end of file diff --git a/vendor/autoload.php b/vendor/autoload.php index 9d528386f..af622c230 100644 --- a/vendor/autoload.php +++ b/vendor/autoload.php @@ -4,4 +4,4 @@ require_once __DIR__ . '/composer/autoload_real.php'; -return ComposerAutoloaderInit5f22c2584a38578ef9509229a7fddb30::getLoader(); +return ComposerAutoloaderInit09c6e4a8b8ab0ea7de4e7ea0381ae108::getLoader(); diff --git a/vendor/composer/ClassLoader.php b/vendor/composer/ClassLoader.php index 95f7e0978..fce8549f0 100644 --- a/vendor/composer/ClassLoader.php +++ b/vendor/composer/ClassLoader.php @@ -279,7 +279,7 @@ public function isClassMapAuthoritative() */ 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/LICENSE b/vendor/composer/LICENSE index 62ecfd8d0..f27399a04 100644 --- a/vendor/composer/LICENSE +++ b/vendor/composer/LICENSE @@ -1,3 +1,4 @@ + Copyright (c) Nils Adermann, Jordi Boggiano Permission is hereby granted, free of charge, to any person obtaining a copy @@ -17,3 +18,4 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + diff --git a/vendor/composer/autoload_commands_classmap.php b/vendor/composer/autoload_commands_classmap.php deleted file mode 100644 index 981d2b363..000000000 --- a/vendor/composer/autoload_commands_classmap.php +++ /dev/null @@ -1,9 +0,0 @@ -addClassMap($classMap); - } - $loader->register(true); - - return $loader; - } -} diff --git a/vendor/composer/autoload_framework_classmap.php b/vendor/composer/autoload_framework_classmap.php deleted file mode 100644 index 29e70ea98..000000000 --- a/vendor/composer/autoload_framework_classmap.php +++ /dev/null @@ -1,248 +0,0 @@ - $vendorDir . '/ivome/graphql-relay-php/src/Connection/ArrayConnection.php', - 'GraphQLRelay\\Connection\\Connection' => $vendorDir . '/ivome/graphql-relay-php/src/Connection/Connection.php', - 'GraphQLRelay\\Mutation\\Mutation' => $vendorDir . '/ivome/graphql-relay-php/src/Mutation/Mutation.php', - 'GraphQLRelay\\Node\\Node' => $vendorDir . '/ivome/graphql-relay-php/src/Node/Node.php', - 'GraphQLRelay\\Node\\Plural' => $vendorDir . '/ivome/graphql-relay-php/src/Node/Plural.php', - 'GraphQLRelay\\Relay' => $vendorDir . '/ivome/graphql-relay-php/src/Relay.php', - 'GraphQL\\Deferred' => $vendorDir . '/webonyx/graphql-php/src/Deferred.php', - 'GraphQL\\Error\\ClientAware' => $vendorDir . '/webonyx/graphql-php/src/Error/ClientAware.php', - 'GraphQL\\Error\\Debug' => $vendorDir . '/webonyx/graphql-php/src/Error/Debug.php', - 'GraphQL\\Error\\Error' => $vendorDir . '/webonyx/graphql-php/src/Error/Error.php', - 'GraphQL\\Error\\FormattedError' => $vendorDir . '/webonyx/graphql-php/src/Error/FormattedError.php', - 'GraphQL\\Error\\InvariantViolation' => $vendorDir . '/webonyx/graphql-php/src/Error/InvariantViolation.php', - 'GraphQL\\Error\\SyntaxError' => $vendorDir . '/webonyx/graphql-php/src/Error/SyntaxError.php', - 'GraphQL\\Error\\UserError' => $vendorDir . '/webonyx/graphql-php/src/Error/UserError.php', - 'GraphQL\\Error\\Warning' => $vendorDir . '/webonyx/graphql-php/src/Error/Warning.php', - 'GraphQL\\Executor\\ExecutionContext' => $vendorDir . '/webonyx/graphql-php/src/Executor/ExecutionContext.php', - 'GraphQL\\Executor\\ExecutionResult' => $vendorDir . '/webonyx/graphql-php/src/Executor/ExecutionResult.php', - 'GraphQL\\Executor\\Executor' => $vendorDir . '/webonyx/graphql-php/src/Executor/Executor.php', - 'GraphQL\\Executor\\Promise\\Adapter\\ReactPromiseAdapter' => $vendorDir . '/webonyx/graphql-php/src/Executor/Promise/Adapter/ReactPromiseAdapter.php', - 'GraphQL\\Executor\\Promise\\Adapter\\SyncPromise' => $vendorDir . '/webonyx/graphql-php/src/Executor/Promise/Adapter/SyncPromise.php', - 'GraphQL\\Executor\\Promise\\Adapter\\SyncPromiseAdapter' => $vendorDir . '/webonyx/graphql-php/src/Executor/Promise/Adapter/SyncPromiseAdapter.php', - 'GraphQL\\Executor\\Promise\\Promise' => $vendorDir . '/webonyx/graphql-php/src/Executor/Promise/Promise.php', - 'GraphQL\\Executor\\Promise\\PromiseAdapter' => $vendorDir . '/webonyx/graphql-php/src/Executor/Promise/PromiseAdapter.php', - 'GraphQL\\Executor\\Values' => $vendorDir . '/webonyx/graphql-php/src/Executor/Values.php', - 'GraphQL\\GraphQL' => $vendorDir . '/webonyx/graphql-php/src/GraphQL.php', - 'GraphQL\\Language\\AST\\ArgumentNode' => $vendorDir . '/webonyx/graphql-php/src/Language/AST/ArgumentNode.php', - 'GraphQL\\Language\\AST\\BooleanValueNode' => $vendorDir . '/webonyx/graphql-php/src/Language/AST/BooleanValueNode.php', - 'GraphQL\\Language\\AST\\DefinitionNode' => $vendorDir . '/webonyx/graphql-php/src/Language/AST/DefinitionNode.php', - 'GraphQL\\Language\\AST\\DirectiveDefinitionNode' => $vendorDir . '/webonyx/graphql-php/src/Language/AST/DirectiveDefinitionNode.php', - 'GraphQL\\Language\\AST\\DirectiveNode' => $vendorDir . '/webonyx/graphql-php/src/Language/AST/DirectiveNode.php', - 'GraphQL\\Language\\AST\\DocumentNode' => $vendorDir . '/webonyx/graphql-php/src/Language/AST/DocumentNode.php', - 'GraphQL\\Language\\AST\\EnumTypeDefinitionNode' => $vendorDir . '/webonyx/graphql-php/src/Language/AST/EnumTypeDefinitionNode.php', - 'GraphQL\\Language\\AST\\EnumTypeExtensionNode' => $vendorDir . '/webonyx/graphql-php/src/Language/AST/EnumTypeExtensionNode.php', - 'GraphQL\\Language\\AST\\EnumValueDefinitionNode' => $vendorDir . '/webonyx/graphql-php/src/Language/AST/EnumValueDefinitionNode.php', - 'GraphQL\\Language\\AST\\EnumValueNode' => $vendorDir . '/webonyx/graphql-php/src/Language/AST/EnumValueNode.php', - 'GraphQL\\Language\\AST\\ExecutableDefinitionNode' => $vendorDir . '/webonyx/graphql-php/src/Language/AST/ExecutableDefinitionNode.php', - 'GraphQL\\Language\\AST\\FieldDefinitionNode' => $vendorDir . '/webonyx/graphql-php/src/Language/AST/FieldDefinitionNode.php', - 'GraphQL\\Language\\AST\\FieldNode' => $vendorDir . '/webonyx/graphql-php/src/Language/AST/FieldNode.php', - 'GraphQL\\Language\\AST\\FloatValueNode' => $vendorDir . '/webonyx/graphql-php/src/Language/AST/FloatValueNode.php', - 'GraphQL\\Language\\AST\\FragmentDefinitionNode' => $vendorDir . '/webonyx/graphql-php/src/Language/AST/FragmentDefinitionNode.php', - 'GraphQL\\Language\\AST\\FragmentSpreadNode' => $vendorDir . '/webonyx/graphql-php/src/Language/AST/FragmentSpreadNode.php', - 'GraphQL\\Language\\AST\\HasSelectionSet' => $vendorDir . '/webonyx/graphql-php/src/Language/AST/HasSelectionSet.php', - 'GraphQL\\Language\\AST\\InlineFragmentNode' => $vendorDir . '/webonyx/graphql-php/src/Language/AST/InlineFragmentNode.php', - 'GraphQL\\Language\\AST\\InputObjectTypeDefinitionNode' => $vendorDir . '/webonyx/graphql-php/src/Language/AST/InputObjectTypeDefinitionNode.php', - 'GraphQL\\Language\\AST\\InputObjectTypeExtensionNode' => $vendorDir . '/webonyx/graphql-php/src/Language/AST/InputObjectTypeExtensionNode.php', - 'GraphQL\\Language\\AST\\InputValueDefinitionNode' => $vendorDir . '/webonyx/graphql-php/src/Language/AST/InputValueDefinitionNode.php', - 'GraphQL\\Language\\AST\\IntValueNode' => $vendorDir . '/webonyx/graphql-php/src/Language/AST/IntValueNode.php', - 'GraphQL\\Language\\AST\\InterfaceTypeDefinitionNode' => $vendorDir . '/webonyx/graphql-php/src/Language/AST/InterfaceTypeDefinitionNode.php', - 'GraphQL\\Language\\AST\\InterfaceTypeExtensionNode' => $vendorDir . '/webonyx/graphql-php/src/Language/AST/InterfaceTypeExtensionNode.php', - 'GraphQL\\Language\\AST\\ListTypeNode' => $vendorDir . '/webonyx/graphql-php/src/Language/AST/ListTypeNode.php', - 'GraphQL\\Language\\AST\\ListValueNode' => $vendorDir . '/webonyx/graphql-php/src/Language/AST/ListValueNode.php', - 'GraphQL\\Language\\AST\\Location' => $vendorDir . '/webonyx/graphql-php/src/Language/AST/Location.php', - 'GraphQL\\Language\\AST\\NameNode' => $vendorDir . '/webonyx/graphql-php/src/Language/AST/NameNode.php', - 'GraphQL\\Language\\AST\\NamedTypeNode' => $vendorDir . '/webonyx/graphql-php/src/Language/AST/NamedTypeNode.php', - 'GraphQL\\Language\\AST\\Node' => $vendorDir . '/webonyx/graphql-php/src/Language/AST/Node.php', - 'GraphQL\\Language\\AST\\NodeKind' => $vendorDir . '/webonyx/graphql-php/src/Language/AST/NodeKind.php', - 'GraphQL\\Language\\AST\\NodeList' => $vendorDir . '/webonyx/graphql-php/src/Language/AST/NodeList.php', - 'GraphQL\\Language\\AST\\NonNullTypeNode' => $vendorDir . '/webonyx/graphql-php/src/Language/AST/NonNullTypeNode.php', - 'GraphQL\\Language\\AST\\NullValueNode' => $vendorDir . '/webonyx/graphql-php/src/Language/AST/NullValueNode.php', - 'GraphQL\\Language\\AST\\ObjectFieldNode' => $vendorDir . '/webonyx/graphql-php/src/Language/AST/ObjectFieldNode.php', - 'GraphQL\\Language\\AST\\ObjectTypeDefinitionNode' => $vendorDir . '/webonyx/graphql-php/src/Language/AST/ObjectTypeDefinitionNode.php', - 'GraphQL\\Language\\AST\\ObjectTypeExtensionNode' => $vendorDir . '/webonyx/graphql-php/src/Language/AST/ObjectTypeExtensionNode.php', - 'GraphQL\\Language\\AST\\ObjectValueNode' => $vendorDir . '/webonyx/graphql-php/src/Language/AST/ObjectValueNode.php', - 'GraphQL\\Language\\AST\\OperationDefinitionNode' => $vendorDir . '/webonyx/graphql-php/src/Language/AST/OperationDefinitionNode.php', - 'GraphQL\\Language\\AST\\OperationTypeDefinitionNode' => $vendorDir . '/webonyx/graphql-php/src/Language/AST/OperationTypeDefinitionNode.php', - 'GraphQL\\Language\\AST\\ScalarTypeDefinitionNode' => $vendorDir . '/webonyx/graphql-php/src/Language/AST/ScalarTypeDefinitionNode.php', - 'GraphQL\\Language\\AST\\ScalarTypeExtensionNode' => $vendorDir . '/webonyx/graphql-php/src/Language/AST/ScalarTypeExtensionNode.php', - 'GraphQL\\Language\\AST\\SchemaDefinitionNode' => $vendorDir . '/webonyx/graphql-php/src/Language/AST/SchemaDefinitionNode.php', - 'GraphQL\\Language\\AST\\SelectionNode' => $vendorDir . '/webonyx/graphql-php/src/Language/AST/SelectionNode.php', - 'GraphQL\\Language\\AST\\SelectionSetNode' => $vendorDir . '/webonyx/graphql-php/src/Language/AST/SelectionSetNode.php', - 'GraphQL\\Language\\AST\\StringValueNode' => $vendorDir . '/webonyx/graphql-php/src/Language/AST/StringValueNode.php', - 'GraphQL\\Language\\AST\\TypeDefinitionNode' => $vendorDir . '/webonyx/graphql-php/src/Language/AST/TypeDefinitionNode.php', - 'GraphQL\\Language\\AST\\TypeExtensionNode' => $vendorDir . '/webonyx/graphql-php/src/Language/AST/TypeExtensionNode.php', - 'GraphQL\\Language\\AST\\TypeNode' => $vendorDir . '/webonyx/graphql-php/src/Language/AST/TypeNode.php', - 'GraphQL\\Language\\AST\\TypeSystemDefinitionNode' => $vendorDir . '/webonyx/graphql-php/src/Language/AST/TypeSystemDefinitionNode.php', - 'GraphQL\\Language\\AST\\UnionTypeDefinitionNode' => $vendorDir . '/webonyx/graphql-php/src/Language/AST/UnionTypeDefinitionNode.php', - 'GraphQL\\Language\\AST\\UnionTypeExtensionNode' => $vendorDir . '/webonyx/graphql-php/src/Language/AST/UnionTypeExtensionNode.php', - 'GraphQL\\Language\\AST\\ValueNode' => $vendorDir . '/webonyx/graphql-php/src/Language/AST/ValueNode.php', - 'GraphQL\\Language\\AST\\VariableDefinitionNode' => $vendorDir . '/webonyx/graphql-php/src/Language/AST/VariableDefinitionNode.php', - 'GraphQL\\Language\\AST\\VariableNode' => $vendorDir . '/webonyx/graphql-php/src/Language/AST/VariableNode.php', - 'GraphQL\\Language\\DirectiveLocation' => $vendorDir . '/webonyx/graphql-php/src/Language/DirectiveLocation.php', - 'GraphQL\\Language\\Lexer' => $vendorDir . '/webonyx/graphql-php/src/Language/Lexer.php', - 'GraphQL\\Language\\Parser' => $vendorDir . '/webonyx/graphql-php/src/Language/Parser.php', - 'GraphQL\\Language\\Printer' => $vendorDir . '/webonyx/graphql-php/src/Language/Printer.php', - 'GraphQL\\Language\\Source' => $vendorDir . '/webonyx/graphql-php/src/Language/Source.php', - 'GraphQL\\Language\\SourceLocation' => $vendorDir . '/webonyx/graphql-php/src/Language/SourceLocation.php', - 'GraphQL\\Language\\Token' => $vendorDir . '/webonyx/graphql-php/src/Language/Token.php', - 'GraphQL\\Language\\Visitor' => $vendorDir . '/webonyx/graphql-php/src/Language/Visitor.php', - 'GraphQL\\Language\\VisitorOperation' => $vendorDir . '/webonyx/graphql-php/src/Language/VisitorOperation.php', - 'GraphQL\\Schema' => $vendorDir . '/webonyx/graphql-php/src/Schema.php', - 'GraphQL\\Server\\Helper' => $vendorDir . '/webonyx/graphql-php/src/Server/Helper.php', - 'GraphQL\\Server\\OperationParams' => $vendorDir . '/webonyx/graphql-php/src/Server/OperationParams.php', - 'GraphQL\\Server\\RequestError' => $vendorDir . '/webonyx/graphql-php/src/Server/RequestError.php', - 'GraphQL\\Server\\ServerConfig' => $vendorDir . '/webonyx/graphql-php/src/Server/ServerConfig.php', - 'GraphQL\\Server\\StandardServer' => $vendorDir . '/webonyx/graphql-php/src/Server/StandardServer.php', - 'GraphQL\\Type\\Definition\\AbstractType' => $vendorDir . '/webonyx/graphql-php/src/Type/Definition/AbstractType.php', - 'GraphQL\\Type\\Definition\\BooleanType' => $vendorDir . '/webonyx/graphql-php/src/Type/Definition/BooleanType.php', - 'GraphQL\\Type\\Definition\\CompositeType' => $vendorDir . '/webonyx/graphql-php/src/Type/Definition/CompositeType.php', - 'GraphQL\\Type\\Definition\\CustomScalarType' => $vendorDir . '/webonyx/graphql-php/src/Type/Definition/CustomScalarType.php', - 'GraphQL\\Type\\Definition\\Directive' => $vendorDir . '/webonyx/graphql-php/src/Type/Definition/Directive.php', - 'GraphQL\\Type\\Definition\\EnumType' => $vendorDir . '/webonyx/graphql-php/src/Type/Definition/EnumType.php', - 'GraphQL\\Type\\Definition\\EnumValueDefinition' => $vendorDir . '/webonyx/graphql-php/src/Type/Definition/EnumValueDefinition.php', - 'GraphQL\\Type\\Definition\\FieldArgument' => $vendorDir . '/webonyx/graphql-php/src/Type/Definition/FieldArgument.php', - 'GraphQL\\Type\\Definition\\FieldDefinition' => $vendorDir . '/webonyx/graphql-php/src/Type/Definition/FieldDefinition.php', - 'GraphQL\\Type\\Definition\\FloatType' => $vendorDir . '/webonyx/graphql-php/src/Type/Definition/FloatType.php', - 'GraphQL\\Type\\Definition\\IDType' => $vendorDir . '/webonyx/graphql-php/src/Type/Definition/IDType.php', - 'GraphQL\\Type\\Definition\\InputObjectField' => $vendorDir . '/webonyx/graphql-php/src/Type/Definition/InputObjectField.php', - 'GraphQL\\Type\\Definition\\InputObjectType' => $vendorDir . '/webonyx/graphql-php/src/Type/Definition/InputObjectType.php', - 'GraphQL\\Type\\Definition\\InputType' => $vendorDir . '/webonyx/graphql-php/src/Type/Definition/InputType.php', - 'GraphQL\\Type\\Definition\\IntType' => $vendorDir . '/webonyx/graphql-php/src/Type/Definition/IntType.php', - 'GraphQL\\Type\\Definition\\InterfaceType' => $vendorDir . '/webonyx/graphql-php/src/Type/Definition/InterfaceType.php', - 'GraphQL\\Type\\Definition\\LeafType' => $vendorDir . '/webonyx/graphql-php/src/Type/Definition/LeafType.php', - 'GraphQL\\Type\\Definition\\ListOfType' => $vendorDir . '/webonyx/graphql-php/src/Type/Definition/ListOfType.php', - 'GraphQL\\Type\\Definition\\NamedType' => $vendorDir . '/webonyx/graphql-php/src/Type/Definition/NamedType.php', - 'GraphQL\\Type\\Definition\\NonNull' => $vendorDir . '/webonyx/graphql-php/src/Type/Definition/NonNull.php', - 'GraphQL\\Type\\Definition\\ObjectType' => $vendorDir . '/webonyx/graphql-php/src/Type/Definition/ObjectType.php', - 'GraphQL\\Type\\Definition\\OutputType' => $vendorDir . '/webonyx/graphql-php/src/Type/Definition/OutputType.php', - 'GraphQL\\Type\\Definition\\ResolveInfo' => $vendorDir . '/webonyx/graphql-php/src/Type/Definition/ResolveInfo.php', - 'GraphQL\\Type\\Definition\\ScalarType' => $vendorDir . '/webonyx/graphql-php/src/Type/Definition/ScalarType.php', - 'GraphQL\\Type\\Definition\\StringType' => $vendorDir . '/webonyx/graphql-php/src/Type/Definition/StringType.php', - 'GraphQL\\Type\\Definition\\Type' => $vendorDir . '/webonyx/graphql-php/src/Type/Definition/Type.php', - 'GraphQL\\Type\\Definition\\UnionType' => $vendorDir . '/webonyx/graphql-php/src/Type/Definition/UnionType.php', - 'GraphQL\\Type\\Definition\\UnmodifiedType' => $vendorDir . '/webonyx/graphql-php/src/Type/Definition/UnmodifiedType.php', - 'GraphQL\\Type\\Definition\\WrappingType' => $vendorDir . '/webonyx/graphql-php/src/Type/Definition/WrappingType.php', - 'GraphQL\\Type\\EagerResolution' => $vendorDir . '/webonyx/graphql-php/src/Type/EagerResolution.php', - 'GraphQL\\Type\\Introspection' => $vendorDir . '/webonyx/graphql-php/src/Type/Introspection.php', - 'GraphQL\\Type\\LazyResolution' => $vendorDir . '/webonyx/graphql-php/src/Type/LazyResolution.php', - 'GraphQL\\Type\\Resolution' => $vendorDir . '/webonyx/graphql-php/src/Type/Resolution.php', - 'GraphQL\\Type\\Schema' => $vendorDir . '/webonyx/graphql-php/src/Type/Schema.php', - 'GraphQL\\Type\\SchemaConfig' => $vendorDir . '/webonyx/graphql-php/src/Type/SchemaConfig.php', - 'GraphQL\\Type\\SchemaValidationContext' => $vendorDir . '/webonyx/graphql-php/src/Type/SchemaValidationContext.php', - 'GraphQL\\Type\\TypeKind' => $vendorDir . '/webonyx/graphql-php/src/Type/Introspection.php', - 'GraphQL\\Utils\\AST' => $vendorDir . '/webonyx/graphql-php/src/Utils/AST.php', - 'GraphQL\\Utils\\ASTDefinitionBuilder' => $vendorDir . '/webonyx/graphql-php/src/Utils/ASTDefinitionBuilder.php', - 'GraphQL\\Utils\\BlockString' => $vendorDir . '/webonyx/graphql-php/src/Utils/BlockString.php', - 'GraphQL\\Utils\\BuildSchema' => $vendorDir . '/webonyx/graphql-php/src/Utils/BuildSchema.php', - 'GraphQL\\Utils\\FindBreakingChanges' => $vendorDir . '/webonyx/graphql-php/src/Utils/FindBreakingChanges.php', - 'GraphQL\\Utils\\MixedStore' => $vendorDir . '/webonyx/graphql-php/src/Utils/MixedStore.php', - 'GraphQL\\Utils\\PairSet' => $vendorDir . '/webonyx/graphql-php/src/Utils/PairSet.php', - 'GraphQL\\Utils\\SchemaPrinter' => $vendorDir . '/webonyx/graphql-php/src/Utils/SchemaPrinter.php', - 'GraphQL\\Utils\\TypeComparators' => $vendorDir . '/webonyx/graphql-php/src/Utils/TypeComparators.php', - 'GraphQL\\Utils\\TypeInfo' => $vendorDir . '/webonyx/graphql-php/src/Utils/TypeInfo.php', - 'GraphQL\\Utils\\Utils' => $vendorDir . '/webonyx/graphql-php/src/Utils/Utils.php', - 'GraphQL\\Utils\\Value' => $vendorDir . '/webonyx/graphql-php/src/Utils/Value.php', - 'GraphQL\\Validator\\DocumentValidator' => $vendorDir . '/webonyx/graphql-php/src/Validator/DocumentValidator.php', - 'GraphQL\\Validator\\Rules\\AbstractQuerySecurity' => $vendorDir . '/webonyx/graphql-php/src/Validator/Rules/AbstractQuerySecurity.php', - 'GraphQL\\Validator\\Rules\\AbstractValidationRule' => $vendorDir . '/webonyx/graphql-php/src/Validator/Rules/AbstractValidationRule.php', - 'GraphQL\\Validator\\Rules\\CustomValidationRule' => $vendorDir . '/webonyx/graphql-php/src/Validator/Rules/CustomValidationRule.php', - 'GraphQL\\Validator\\Rules\\DisableIntrospection' => $vendorDir . '/webonyx/graphql-php/src/Validator/Rules/DisableIntrospection.php', - 'GraphQL\\Validator\\Rules\\ExecutableDefinitions' => $vendorDir . '/webonyx/graphql-php/src/Validator/Rules/ExecutableDefinitions.php', - 'GraphQL\\Validator\\Rules\\FieldsOnCorrectType' => $vendorDir . '/webonyx/graphql-php/src/Validator/Rules/FieldsOnCorrectType.php', - 'GraphQL\\Validator\\Rules\\FragmentsOnCompositeTypes' => $vendorDir . '/webonyx/graphql-php/src/Validator/Rules/FragmentsOnCompositeTypes.php', - 'GraphQL\\Validator\\Rules\\KnownArgumentNames' => $vendorDir . '/webonyx/graphql-php/src/Validator/Rules/KnownArgumentNames.php', - 'GraphQL\\Validator\\Rules\\KnownDirectives' => $vendorDir . '/webonyx/graphql-php/src/Validator/Rules/KnownDirectives.php', - 'GraphQL\\Validator\\Rules\\KnownFragmentNames' => $vendorDir . '/webonyx/graphql-php/src/Validator/Rules/KnownFragmentNames.php', - 'GraphQL\\Validator\\Rules\\KnownTypeNames' => $vendorDir . '/webonyx/graphql-php/src/Validator/Rules/KnownTypeNames.php', - 'GraphQL\\Validator\\Rules\\LoneAnonymousOperation' => $vendorDir . '/webonyx/graphql-php/src/Validator/Rules/LoneAnonymousOperation.php', - 'GraphQL\\Validator\\Rules\\NoFragmentCycles' => $vendorDir . '/webonyx/graphql-php/src/Validator/Rules/NoFragmentCycles.php', - 'GraphQL\\Validator\\Rules\\NoUndefinedVariables' => $vendorDir . '/webonyx/graphql-php/src/Validator/Rules/NoUndefinedVariables.php', - 'GraphQL\\Validator\\Rules\\NoUnusedFragments' => $vendorDir . '/webonyx/graphql-php/src/Validator/Rules/NoUnusedFragments.php', - 'GraphQL\\Validator\\Rules\\NoUnusedVariables' => $vendorDir . '/webonyx/graphql-php/src/Validator/Rules/NoUnusedVariables.php', - 'GraphQL\\Validator\\Rules\\OverlappingFieldsCanBeMerged' => $vendorDir . '/webonyx/graphql-php/src/Validator/Rules/OverlappingFieldsCanBeMerged.php', - 'GraphQL\\Validator\\Rules\\PossibleFragmentSpreads' => $vendorDir . '/webonyx/graphql-php/src/Validator/Rules/PossibleFragmentSpreads.php', - 'GraphQL\\Validator\\Rules\\ProvidedNonNullArguments' => $vendorDir . '/webonyx/graphql-php/src/Validator/Rules/ProvidedNonNullArguments.php', - 'GraphQL\\Validator\\Rules\\QueryComplexity' => $vendorDir . '/webonyx/graphql-php/src/Validator/Rules/QueryComplexity.php', - 'GraphQL\\Validator\\Rules\\QueryDepth' => $vendorDir . '/webonyx/graphql-php/src/Validator/Rules/QueryDepth.php', - 'GraphQL\\Validator\\Rules\\ScalarLeafs' => $vendorDir . '/webonyx/graphql-php/src/Validator/Rules/ScalarLeafs.php', - 'GraphQL\\Validator\\Rules\\UniqueArgumentNames' => $vendorDir . '/webonyx/graphql-php/src/Validator/Rules/UniqueArgumentNames.php', - 'GraphQL\\Validator\\Rules\\UniqueDirectivesPerLocation' => $vendorDir . '/webonyx/graphql-php/src/Validator/Rules/UniqueDirectivesPerLocation.php', - 'GraphQL\\Validator\\Rules\\UniqueFragmentNames' => $vendorDir . '/webonyx/graphql-php/src/Validator/Rules/UniqueFragmentNames.php', - 'GraphQL\\Validator\\Rules\\UniqueInputFieldNames' => $vendorDir . '/webonyx/graphql-php/src/Validator/Rules/UniqueInputFieldNames.php', - 'GraphQL\\Validator\\Rules\\UniqueOperationNames' => $vendorDir . '/webonyx/graphql-php/src/Validator/Rules/UniqueOperationNames.php', - 'GraphQL\\Validator\\Rules\\UniqueVariableNames' => $vendorDir . '/webonyx/graphql-php/src/Validator/Rules/UniqueVariableNames.php', - 'GraphQL\\Validator\\Rules\\ValuesOfCorrectType' => $vendorDir . '/webonyx/graphql-php/src/Validator/Rules/ValuesOfCorrectType.php', - 'GraphQL\\Validator\\Rules\\VariablesAreInputTypes' => $vendorDir . '/webonyx/graphql-php/src/Validator/Rules/VariablesAreInputTypes.php', - 'GraphQL\\Validator\\Rules\\VariablesDefaultValueAllowed' => $vendorDir . '/webonyx/graphql-php/src/Validator/Rules/VariablesDefaultValueAllowed.php', - 'GraphQL\\Validator\\Rules\\VariablesInAllowedPosition' => $vendorDir . '/webonyx/graphql-php/src/Validator/Rules/VariablesInAllowedPosition.php', - 'GraphQL\\Validator\\ValidationContext' => $vendorDir . '/webonyx/graphql-php/src/Validator/ValidationContext.php', - 'WPGraphQL\\AppContext' => $baseDir . '/src/AppContext.php', - 'WPGraphQL\\Connection\\Comments' => $baseDir . '/src/Connection/Comments.php', - 'WPGraphQL\\Connection\\MenuItems' => $baseDir . '/src/Connection/MenuItems.php', - 'WPGraphQL\\Connection\\Menus' => $baseDir . '/src/Connection/Menus.php', - 'WPGraphQL\\Connection\\Plugins' => $baseDir . '/src/Connection/Plugins.php', - 'WPGraphQL\\Connection\\PostObjects' => $baseDir . '/src/Connection/PostObjects.php', - 'WPGraphQL\\Connection\\TermObjects' => $baseDir . '/src/Connection/TermObjects.php', - 'WPGraphQL\\Connection\\Themes' => $baseDir . '/src/Connection/Themes.php', - 'WPGraphQL\\Connection\\UserRoles' => $baseDir . '/src/Connection/UserRoles.php', - 'WPGraphQL\\Connection\\Users' => $baseDir . '/src/Connection/Users.php', - 'WPGraphQL\\Data\\CommentConnectionResolver' => $baseDir . '/src/Data/CommentConnectionResolver.php', - 'WPGraphQL\\Data\\CommentMutation' => $baseDir . '/src/Data/CommentMutation.php', - 'WPGraphQL\\Data\\Config' => $baseDir . '/src/Data/Config.php', - 'WPGraphQL\\Data\\ConnectionResolver' => $baseDir . '/src/Data/ConnectionResolver.php', - 'WPGraphQL\\Data\\ConnectionResolverInterface' => $baseDir . '/src/Data/ConnectionResolverInterface.php', - 'WPGraphQL\\Data\\DataSource' => $baseDir . '/src/Data/DataSource.php', - 'WPGraphQL\\Data\\Loader' => $baseDir . '/src/Data/Loader.php', - 'WPGraphQL\\Data\\MediaItemMutation' => $baseDir . '/src/Data/MediaItemMutation.php', - 'WPGraphQL\\Data\\MenuConnectionResolver' => $baseDir . '/src/Data/MenuConnectionResolver.php', - 'WPGraphQL\\Data\\MenuItemConnectionResolver' => $baseDir . '/src/Data/MenuItemConnectionResolver.php', - 'WPGraphQL\\Data\\PluginConnectionResolver' => $baseDir . '/src/Data/PluginConnectionResolver.php', - 'WPGraphQL\\Data\\PostObjectConnectionResolver' => $baseDir . '/src/Data/PostObjectConnectionResolver.php', - 'WPGraphQL\\Data\\PostObjectMutation' => $baseDir . '/src/Data/PostObjectMutation.php', - 'WPGraphQL\\Data\\TermObjectConnectionResolver' => $baseDir . '/src/Data/TermObjectConnectionResolver.php', - 'WPGraphQL\\Data\\TermObjectMutation' => $baseDir . '/src/Data/TermObjectMutation.php', - 'WPGraphQL\\Data\\ThemeConnectionResolver' => $baseDir . '/src/Data/ThemeConnectionResolver.php', - 'WPGraphQL\\Data\\UserConnectionResolver' => $baseDir . '/src/Data/UserConnectionResolver.php', - 'WPGraphQL\\Data\\UserMutation' => $baseDir . '/src/Data/UserMutation.php', - 'WPGraphQL\\Data\\UserRoleConnectionResolver' => $baseDir . '/src/Data/UserRoleConnectionResolver.php', - 'WPGraphQL\\Mutation\\CommentCreate' => $baseDir . '/src/Mutation/CommentCreate.php', - 'WPGraphQL\\Mutation\\CommentDelete' => $baseDir . '/src/Mutation/CommentDelete.php', - 'WPGraphQL\\Mutation\\CommentRestore' => $baseDir . '/src/Mutation/CommentRestore.php', - 'WPGraphQL\\Mutation\\CommentUpdate' => $baseDir . '/src/Mutation/CommentUpdate.php', - 'WPGraphQL\\Mutation\\MediaItemCreate' => $baseDir . '/src/Mutation/MediaItemCreate.php', - 'WPGraphQL\\Mutation\\MediaItemDelete' => $baseDir . '/src/Mutation/MediaItemDelete.php', - 'WPGraphQL\\Mutation\\MediaItemUpdate' => $baseDir . '/src/Mutation/MediaItemUpdate.php', - 'WPGraphQL\\Mutation\\PostObjectCreate' => $baseDir . '/src/Mutation/PostObjectCreate.php', - 'WPGraphQL\\Mutation\\PostObjectDelete' => $baseDir . '/src/Mutation/PostObjectDelete.php', - 'WPGraphQL\\Mutation\\PostObjectUpdate' => $baseDir . '/src/Mutation/PostObjectUpdate.php', - 'WPGraphQL\\Mutation\\ResetUserPassword' => $baseDir . '/src/Mutation/ResetUserPassword.php', - 'WPGraphQL\\Mutation\\SendPasswordResetEmail' => $baseDir . '/src/Mutation/SendPasswordResetEmail.php', - 'WPGraphQL\\Mutation\\TermObjectCreate' => $baseDir . '/src/Mutation/TermObjectCreate.php', - 'WPGraphQL\\Mutation\\TermObjectDelete' => $baseDir . '/src/Mutation/TermObjectDelete.php', - 'WPGraphQL\\Mutation\\TermObjectUpdate' => $baseDir . '/src/Mutation/TermObjectUpdate.php', - 'WPGraphQL\\Mutation\\UpdateSettings' => $baseDir . '/src/Mutation/UpdateSettings.php', - 'WPGraphQL\\Mutation\\UserCreate' => $baseDir . '/src/Mutation/UserCreate.php', - 'WPGraphQL\\Mutation\\UserDelete' => $baseDir . '/src/Mutation/UserDelete.php', - 'WPGraphQL\\Mutation\\UserRegister' => $baseDir . '/src/Mutation/UserRegister.php', - 'WPGraphQL\\Mutation\\UserUpdate' => $baseDir . '/src/Mutation/UserUpdate.php', - 'WPGraphQL\\Request' => $baseDir . '/src/Request.php', - 'WPGraphQL\\Router' => $baseDir . '/src/Router.php', - 'WPGraphQL\\SchemaRegistry' => $baseDir . '/src/SchemaRegistry.php', - 'WPGraphQL\\Server\\WPHelper' => $baseDir . '/src/Server/WPHelper.php', - 'WPGraphQL\\TypeRegistry' => $baseDir . '/src/TypeRegistry.php', - 'WPGraphQL\\Type\\WPEnumType' => $baseDir . '/src/Type/WPEnumType.php', - 'WPGraphQL\\Type\\WPInputObjectType' => $baseDir . '/src/Type/WPInputObjectType.php', - 'WPGraphQL\\Type\\WPObjectType' => $baseDir . '/src/Type/WPObjectType.php', - 'WPGraphQL\\Type\\WPUnionType' => $baseDir . '/src/Type/WPUnionType.php', - 'WPGraphQL\\Types' => $baseDir . '/src/Types.php', - 'WPGraphQL\\Utils\\InstrumentSchema' => $baseDir . '/src/Utils/InstrumentSchema.php', - 'WPGraphQL\\WPSchema' => $baseDir . '/src/WPSchema.php', -); diff --git a/vendor/composer/autoload_framework_real.php b/vendor/composer/autoload_framework_real.php deleted file mode 100644 index 2137a7865..000000000 --- a/vendor/composer/autoload_framework_real.php +++ /dev/null @@ -1,34 +0,0 @@ -addClassMap($classMap); - } - $loader->register(true); - - return $loader; - } -} diff --git a/vendor/composer/autoload_real.php b/vendor/composer/autoload_real.php index 55bd7488b..a577237f3 100644 --- a/vendor/composer/autoload_real.php +++ b/vendor/composer/autoload_real.php @@ -2,7 +2,7 @@ // autoload_real.php @generated by Composer -class ComposerAutoloaderInit5f22c2584a38578ef9509229a7fddb30 +class ComposerAutoloaderInit09c6e4a8b8ab0ea7de4e7ea0381ae108 { private static $loader; @@ -19,15 +19,15 @@ public static function getLoader() return self::$loader; } - spl_autoload_register(array('ComposerAutoloaderInit5f22c2584a38578ef9509229a7fddb30', 'loadClassLoader'), true, true); + spl_autoload_register(array('ComposerAutoloaderInit09c6e4a8b8ab0ea7de4e7ea0381ae108', 'loadClassLoader'), true, true); self::$loader = $loader = new \Composer\Autoload\ClassLoader(); - spl_autoload_unregister(array('ComposerAutoloaderInit5f22c2584a38578ef9509229a7fddb30', 'loadClassLoader')); + spl_autoload_unregister(array('ComposerAutoloaderInit09c6e4a8b8ab0ea7de4e7ea0381ae108', '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\ComposerStaticInit5f22c2584a38578ef9509229a7fddb30::getInitializer($loader)); + call_user_func(\Composer\Autoload\ComposerStaticInit09c6e4a8b8ab0ea7de4e7ea0381ae108::getInitializer($loader)); } else { $map = require __DIR__ . '/autoload_namespaces.php'; foreach ($map as $namespace => $path) { diff --git a/vendor/composer/autoload_static.php b/vendor/composer/autoload_static.php index 3afedccb5..3578b5449 100644 --- a/vendor/composer/autoload_static.php +++ b/vendor/composer/autoload_static.php @@ -4,7 +4,7 @@ namespace Composer\Autoload; -class ComposerStaticInit5f22c2584a38578ef9509229a7fddb30 +class ComposerStaticInit09c6e4a8b8ab0ea7de4e7ea0381ae108 { public static $prefixLengthsPsr4 = array ( 'W' => @@ -273,9 +273,9 @@ class ComposerStaticInit5f22c2584a38578ef9509229a7fddb30 public static function getInitializer(ClassLoader $loader) { return \Closure::bind(function () use ($loader) { - $loader->prefixLengthsPsr4 = ComposerStaticInit5f22c2584a38578ef9509229a7fddb30::$prefixLengthsPsr4; - $loader->prefixDirsPsr4 = ComposerStaticInit5f22c2584a38578ef9509229a7fddb30::$prefixDirsPsr4; - $loader->classMap = ComposerStaticInit5f22c2584a38578ef9509229a7fddb30::$classMap; + $loader->prefixLengthsPsr4 = ComposerStaticInit09c6e4a8b8ab0ea7de4e7ea0381ae108::$prefixLengthsPsr4; + $loader->prefixDirsPsr4 = ComposerStaticInit09c6e4a8b8ab0ea7de4e7ea0381ae108::$prefixDirsPsr4; + $loader->classMap = ComposerStaticInit09c6e4a8b8ab0ea7de4e7ea0381ae108::$classMap; }, null, ClassLoader::class); } diff --git a/wp-graphql.php b/wp-graphql.php index d89580efb..90d25160c 100755 --- a/wp-graphql.php +++ b/wp-graphql.php @@ -34,6 +34,13 @@ require_once( __DIR__ . '/c3.php' ); } +/** + * If the wordpress settings patch exists, require it. + */ +if ( file_exists( __DIR__ . '/settings-patch.php' ) ) { + require_once( __DIR__ . '/settings-patch.php' ); +} + /** * This plugin brings the power of GraphQL (http://graphql.org/) to WordPress. * From bfe8eae83d0d42b6c10ab3c815d057e786f0a054 Mon Sep 17 00:00:00 2001 From: Geoff Taylor Date: Wed, 23 Jan 2019 01:47:18 -0500 Subject: [PATCH 2/7] settings-patch.php require statement moved --- wp-graphql.php | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/wp-graphql.php b/wp-graphql.php index 90d25160c..c54ff47a8 100755 --- a/wp-graphql.php +++ b/wp-graphql.php @@ -34,13 +34,6 @@ require_once( __DIR__ . '/c3.php' ); } -/** - * If the wordpress settings patch exists, require it. - */ -if ( file_exists( __DIR__ . '/settings-patch.php' ) ) { - require_once( __DIR__ . '/settings-patch.php' ); -} - /** * This plugin brings the power of GraphQL (http://graphql.org/) to WordPress. * @@ -232,6 +225,9 @@ private function includes() { // Required non-autoloaded classes require_once( WPGRAPHQL_PLUGIN_DIR . 'access-functions.php' ); + // Required wordpress core patches + require_once( WPGRAPHQL_PLUGIN_DIR . 'settings-patch.php' ); + } /** From cf5e4ff469188831b2fd0d8730edb95b2657f266 Mon Sep 17 00:00:00 2001 From: Geoff Taylor Date: Thu, 24 Jan 2019 12:51:36 -0500 Subject: [PATCH 3/7] privacy & permalink settings added --- settings-patch.php | 37 +++++++++++++++-- tests/wpunit/PatchSettingsTest.php | 66 +++++++++++++++++++----------- 2 files changed, 75 insertions(+), 28 deletions(-) diff --git a/settings-patch.php b/settings-patch.php index 2a7452db6..7cc98e7f3 100644 --- a/settings-patch.php +++ b/settings-patch.php @@ -94,7 +94,8 @@ function patch_whitelist_options() { 'thread_comments' => array( 'show_in_rest' => true, 'type' => 'boolean', - 'description' => __( 'Enable threaded (nested) comments', 'wp-graphql' ) + 'description' => __( 'Enable threaded (nested) comments', 'wp-graphql' ), + 'default' => false ), 'thread_comments_depth' => array( 'show_in_rest' => true, @@ -104,7 +105,8 @@ function patch_whitelist_options() { 'page_comments' => array( 'show_in_rest' => true, 'type' => 'boolean', - 'description' => __( 'Break comments into pages', 'wp-graphql' ) + 'description' => __( 'Break comments into pages', 'wp-graphql' ), + 'default' => false ), 'comments_per_page' => array( 'show_in_rest' => true, @@ -132,7 +134,8 @@ function patch_whitelist_options() { 'comment_registration' => array( 'show_in_rest' => true, 'type' => 'boolean', - 'description' => __( 'Users must be registered and logged in to comment', 'wp-graphql' ) + 'description' => __( 'Users must be registered and logged in to comment', 'wp-graphql' ), + 'default' => false ), 'show_comments_cookies_opt_in' => array( 'show_in_rest' => true, @@ -200,6 +203,34 @@ function patch_whitelist_options() { 'description' => __( 'Organize my uploads into month- and year-based folders', 'wp-graphql' ) ) ), + 'permalink' => array( + 'permalink_structure' => array( + 'show_in_rest' => array( + 'name' => 'structure' + ), + 'type' => 'string', + 'description' => __( 'Custom URL structures use for posts', 'wp-graphql' ) + ), + 'category_base' => array( + 'show_in_rest' => true, + 'type' => 'string', + 'description' => __( 'Base Category URLs', 'wp-graphql' ) + ), + 'tag_base' => array( + 'show_in_rest' => true, + 'type' => 'string', + 'description' => __( 'Base Tag URLs', 'wp-graphql' ) + ), + ), + 'privacy' => array( + 'wp_page_for_privacy_policy' => array( + 'show_in_rest' => array( + 'name' => 'page' + ), + 'type' => 'string', + 'description' => __( 'WP Page ID of Privacy Policy page', 'wp-graphql' ) + ), + ), 'reading' => array( 'posts_per_rss' => array( 'show_in_rest' => true, diff --git a/tests/wpunit/PatchSettingsTest.php b/tests/wpunit/PatchSettingsTest.php index f661cf5ee..b76d53dd7 100644 --- a/tests/wpunit/PatchSettingsTest.php +++ b/tests/wpunit/PatchSettingsTest.php @@ -27,24 +27,24 @@ public function testSettingsPatch() 'default_comment_status' => 'open', 'comments_notify' => 1, 'moderation_notify' => 1, - 'comment_moderation' => null, + 'comment_moderation' => true, 'require_name_email' => 1, 'comment_whitelist' => 1, 'comment_max_links' => 2, - 'moderation_keys' => null, - 'blacklist_keys' => null, + 'moderation_keys' => 'Yep\nKey\nList', + 'blacklist_keys' => 'Yep\nKey\nList', 'show_avatars' => 1, 'avatar_rating' => 'G', 'avatar_default' => 'mystery', - 'close_comments_for_old_posts' => null, + 'close_comments_for_old_posts' => true, 'close_comments_days_old' => 14, 'thread_comments' => 1, 'thread_comments_depth' => 5, - 'page_comments' => null, + 'page_comments' => true, 'default_comments_page' => 'newest', 'comment_order' => 'asc', - 'comment_registration' => null, - 'show_comments_cookies_opt_in' => null, + 'comment_registration' => true, + 'show_comments_cookies_opt_in' => false, 'thumbnail_size_w' => 150, 'thumbnail_size_h' => 150, 'thumbnail_crop' => 1, @@ -53,13 +53,17 @@ public function testSettingsPatch() 'large_size_w' => 1024, 'large_size_h' => 1024, 'posts_per_rss' => 10, - 'rss_use_excerpt' => null, + 'rss_use_excerpt' => true, 'show_on_front' => 'posts', - 'page_on_front' => null, - 'page_for_posts' => null, - 'blog_public' => 1, + 'page_on_front' => '1', + 'page_for_posts' => '2', + 'blog_public' => true, 'default_email_category' => 1, 'default_link_category' => 2, + 'permalink_structure' => '/archives/%post_id%', + 'category_base' => 'kate', + 'tag_base' => 'boggy', + 'wp_page_for_privacy_policy' => '2' ]; foreach ( $mock_options as $mock_option_key => $mock_value ) { @@ -101,6 +105,14 @@ public function testSettingsPatch() largeSizeW largeSizeH } + permalinkSettings{ + structure + categoryBase + tagBase + } + privacySettings{ + page + } readingSettings { postsPerRss rssUseExcerpt @@ -113,7 +125,6 @@ public function testSettingsPatch() defaultEmailCategory defaultLinkCategory } - } "; $actual = do_graphql_request( $query ); @@ -125,26 +136,25 @@ public function testSettingsPatch() 'defaultCommentStatus' => 'open', 'commentsNotify' => 1, 'moderationNotify' => 1, - 'commentModeration' => null, + 'commentModeration' => true, 'requireNameEmail' => 1, 'commentWhitelist' => 1, 'commentMaxLinks' => 2, - 'moderationKeys' => null, - 'blacklistKeys' => null, + 'moderationKeys' => 'Yep\nKey\nList', + 'blacklistKeys' => 'Yep\nKey\nList', 'showAvatars' => 1, 'avatarRating' => 'G', 'avatarDefault' => 'mystery', - 'closeCommentsForOldPosts' => null, + 'closeCommentsForOldPosts' => true, 'closeCommentsDaysOld' => 14, 'threadComments' => 1, 'threadCommentsDepth' => 5, - 'pageComments' => null, + 'pageComments' => true, 'defaultCommentsPage' => 'newest', 'commentOrder' => 'asc', - 'commentRegistration' => null, + 'commentRegistration' => true, 'showCommentsCookiesOptIn' => null, ), - 'mediaSettings' => array( 'thumbnailSizeW' => 150, 'thumbnailSizeH' => 150, @@ -154,16 +164,22 @@ public function testSettingsPatch() 'largeSizeW' => 1024, 'largeSizeH' => 1024, ), - + 'permalinkSettings' => array( + 'structure' => '/archives/%post_id%', + 'categoryBase' => 'kate', + 'tagBase' => 'boggy' + ), + 'privacySettings' => array( + 'page' => '2' + ), 'readingSettings' => array( 'postsPerRss' => 10, - 'rssUseExcerpt' => null, + 'rssUseExcerpt' => '1', 'showOnFront' => 'posts', - 'pageOnFront' => null, - 'pageForPosts' => null, - 'blogPublic' => 1, + 'pageOnFront' => '1', + 'pageForPosts' => '2', + 'blogPublic' => true, ), - 'writingSettings' => array( 'defaultEmailCategory' => 1, 'defaultLinkCategory' => 2, From 84fd06b30d0967ea21910070e6bb94801b13e6c1 Mon Sep 17 00:00:00 2001 From: Geoff Taylor Date: Thu, 24 Jan 2019 20:00:32 -0500 Subject: [PATCH 4/7] mutations test add to PatchSettingsTest.php --- tests/wpunit/PatchSettingsTest.php | 208 ++++++++++++++++++++++++++++- 1 file changed, 204 insertions(+), 4 deletions(-) diff --git a/tests/wpunit/PatchSettingsTest.php b/tests/wpunit/PatchSettingsTest.php index b76d53dd7..94f1dcf6c 100644 --- a/tests/wpunit/PatchSettingsTest.php +++ b/tests/wpunit/PatchSettingsTest.php @@ -2,13 +2,31 @@ class PatchSettingsTest extends \Codeception\TestCase\WPTestCase { + public $subscriber; + public $author; + public $editor; + public $admin; public function setUp() { // before parent::setUp(); - // your set up methods here + $this->subscriber = $this->factory->user->create( [ + 'role' => 'subscriber', + ] ); + + $this->author = $this->factory->user->create( [ + 'role' => 'author', + ] ); + + $this->editor = $this->factory->user->create( [ + 'role' => 'editor', + ] ); + + $this->admin = $this->factory->user->create( [ + 'role' => 'administrator', + ] ); } public function tearDown() @@ -20,7 +38,7 @@ public function tearDown() } // tests - public function testSettingsPatch() + public function testPatchSettingsQuery() { $mock_options = [ 'default_pingback_flag' => 1, @@ -97,8 +115,8 @@ public function testSettingsPatch() showCommentsCookiesOptIn } mediaSettings { - thumbnailSizeW, - thumbnailSizeH, + thumbnailSizeW + thumbnailSizeH thumbnailCrop mediumSizeW mediumSizeH @@ -198,4 +216,186 @@ public function testSettingsPatch() $this->assertEquals( $actual, $expected ); } + public function testPatchSettingsMutation() + { + $updateSettingsInput = array( + 'input' => array( + 'clientMutationId' => 'someId', + 'discussionSettingsDefaultPingbackFlag' => true, + 'discussionSettingsDefaultCommentStatus' => 'close', + 'discussionSettingsCommentsNotify' => true, + 'discussionSettingsModerationNotify' => true, + 'discussionSettingsCommentModeration' => true, + 'discussionSettingsRequireNameEmail' => true, + 'discussionSettingsCommentWhitelist' => true, + 'discussionSettingsCommentMaxLinks' => 4, + 'discussionSettingsModerationKeys' => '', + 'discussionSettingsBlacklistKeys' => '', + 'discussionSettingsShowAvatars' => false, + 'discussionSettingsAvatarRating' => 'X', + 'discussionSettingsAvatarDefault' => 'blank', + 'discussionSettingsCloseCommentsForOldPosts' => false, + 'discussionSettingsCloseCommentsDaysOld' => 7, + 'discussionSettingsThreadComments' => true, + 'discussionSettingsThreadCommentsDepth' => 2, + 'discussionSettingsPageComments' => true, + 'discussionSettingsDefaultCommentsPage' => 'oldest', + 'discussionSettingsCommentOrder' => 'desc', + 'discussionSettingsCommentRegistration' => false, + 'discussionSettingsShowCommentsCookiesOptIn' => false, + 'mediaSettingsThumbnailSizeW' => 256, + 'mediaSettingsThumbnailSizeH' => 256, + 'mediaSettingsThumbnailCrop' => true, + 'mediaSettingsMediumSizeW' => 512, + 'mediaSettingsMediumSizeH' => 512, + 'mediaSettingsLargeSizeW' => 1024, + 'mediaSettingsLargeSizeH' => 1024, + 'permalinkSettingsStructure' => '/%year%/%monthnum%/%postname%/', + 'permalinkSettingsCategoryBase' => 'louie', + 'permalinkSettingsTagBase' => 'duck', + 'privacySettingsPage' => '1', + 'readingSettingsPostsPerRss' => 5, + 'readingSettingsRssUseExcerpt' => '0', + 'readingSettingsShowOnFront' => 'page', + 'readingSettingsPageOnFront' => '2', + 'readingSettingsPageForPosts' => '1', + 'readingSettingsBlogPublic' => false, + 'writingSettingsDefaultEmailCategory' => 2, + 'writingSettingsDefaultLinkCategory' => 1 + ) + ); + + $mutation = ' + mutation updateSettings( $input: UpdateSettingsInput! ) { + updateSettings( input: $input ) { + clientMutationId + allSettings{ + discussionSettingsDefaultPingbackFlag + discussionSettingsDefaultCommentStatus + discussionSettingsCommentsNotify + discussionSettingsModerationNotify + discussionSettingsCommentModeration + discussionSettingsRequireNameEmail + discussionSettingsCommentWhitelist + discussionSettingsCommentMaxLinks + discussionSettingsModerationKeys + discussionSettingsBlacklistKeys + discussionSettingsShowAvatars + discussionSettingsAvatarRating + discussionSettingsAvatarDefault + discussionSettingsCloseCommentsForOldPosts + discussionSettingsCloseCommentsDaysOld + discussionSettingsThreadComments + discussionSettingsThreadCommentsDepth + discussionSettingsPageComments + discussionSettingsDefaultCommentsPage + discussionSettingsCommentOrder + discussionSettingsCommentRegistration + discussionSettingsShowCommentsCookiesOptIn + mediaSettingsThumbnailSizeW + mediaSettingsThumbnailSizeH + mediaSettingsThumbnailCrop + mediaSettingsMediumSizeW + mediaSettingsMediumSizeH + mediaSettingsLargeSizeW + mediaSettingsLargeSizeH + permalinkSettingsStructure + permalinkSettingsCategoryBase + permalinkSettingsTagBase + privacySettingsPage + readingSettingsPostsPerRss + readingSettingsRssUseExcerpt + readingSettingsShowOnFront + readingSettingsPageOnFront + readingSettingsPageForPosts + readingSettingsBlogPublic + writingSettingsDefaultEmailCategory + writingSettingsDefaultLinkCategory + } + } + } + '; + + /** + * Set the current user as the subscriber so we can test, and expect to fail + */ + wp_set_current_user( $this->subscriber ); + + $actual = do_graphql_request( $mutation, 'updateSettings', $updateSettingsInput ); + + /** + * use --debug flag to view + */ + \Codeception\Util\Debug::debug( $actual ); + + $this->assertArrayHasKey( 'errors', $actual ); + + /** + * Set the current user as the admin so we can test, and expect to pass + */ + wp_set_current_user( $this->admin ); + + $actual = do_graphql_request( $mutation, 'updateSettings', $updateSettingsInput ); + + $expected = array( + 'data' => array( + 'updateSettings' => array( + 'clientMutationId' => 'someId', + 'allSettings' => array( + 'discussionSettingsDefaultPingbackFlag' => true, + 'discussionSettingsDefaultCommentStatus' => 'close', + 'discussionSettingsCommentsNotify' => true, + 'discussionSettingsModerationNotify' => true, + 'discussionSettingsCommentModeration' => true, + 'discussionSettingsRequireNameEmail' => true, + 'discussionSettingsCommentWhitelist' => true, + 'discussionSettingsCommentMaxLinks' => 4, + 'discussionSettingsModerationKeys' => '', + 'discussionSettingsBlacklistKeys' => '', + 'discussionSettingsShowAvatars' => false, + 'discussionSettingsAvatarRating' => 'X', + 'discussionSettingsAvatarDefault' => 'blank', + 'discussionSettingsCloseCommentsForOldPosts' => false, + 'discussionSettingsCloseCommentsDaysOld' => 7, + 'discussionSettingsThreadComments' => true, + 'discussionSettingsThreadCommentsDepth' => 2, + 'discussionSettingsPageComments' => true, + 'discussionSettingsDefaultCommentsPage' => 'oldest', + 'discussionSettingsCommentOrder' => 'desc', + 'discussionSettingsCommentRegistration' => false, + 'discussionSettingsShowCommentsCookiesOptIn' => false, + 'mediaSettingsThumbnailSizeW' => 256, + 'mediaSettingsThumbnailSizeH' => 256, + 'mediaSettingsThumbnailCrop' => true, + 'mediaSettingsMediumSizeW' => 512, + 'mediaSettingsMediumSizeH' => 512, + 'mediaSettingsLargeSizeW' => 1024, + 'mediaSettingsLargeSizeH' => 1024, + 'permalinkSettingsStructure' => '/%year%/%monthnum%/%postname%/', + 'permalinkSettingsCategoryBase' => 'louie', + 'permalinkSettingsTagBase' => 'duck', + 'privacySettingsPage' => '1', + 'readingSettingsPostsPerRss' => 5, + 'readingSettingsRssUseExcerpt' => '', + 'readingSettingsShowOnFront' => 'page', + 'readingSettingsPageOnFront' => '2', + 'readingSettingsPageForPosts' => '1', + 'readingSettingsBlogPublic' => false, + 'writingSettingsDefaultEmailCategory' => 2, + 'writingSettingsDefaultLinkCategory' => 1 + ) + ) + ) + ); + + /** + * use --debug flag to view + */ + \Codeception\Util\Debug::debug( $actual ); + + /** + * Compare the actual output vs the expected output + */ + $this->assertEquals( $actual, $expected ); + } } \ No newline at end of file From 8a89219a00aa0468513982bb31971fc415d7ad32 Mon Sep 17 00:00:00 2001 From: Geoff Taylor Date: Fri, 25 Jan 2019 22:31:00 -0500 Subject: [PATCH 5/7] settings renamed for schema --- settings-patch.php | 24 +- tests/wpunit/PatchSettingsTest.php | 690 ++++++++++++++--------------- 2 files changed, 363 insertions(+), 351 deletions(-) diff --git a/settings-patch.php b/settings-patch.php index 7cc98e7f3..b70898924 100644 --- a/settings-patch.php +++ b/settings-patch.php @@ -145,12 +145,16 @@ function patch_whitelist_options() { ), 'media' => array( 'thumbnail_size_w' => array( - 'show_in_rest' => true, + 'show_in_rest' => array( + 'name' => 'thumbnail_size_width' + ), 'type' => 'integer', 'description' => __( 'Maximum width for thumbnail-sized content in pixels to use when adding an image to the Media Library', 'wp-graphql' ) ), 'thumbnail_size_h' => array( - 'show_in_rest' => true, + 'show_in_rest' => array( + 'name' => 'thumbnail_size_height' + ), 'type' => 'integer', 'description' => __( 'Maximum height for thumbnail-sized content in pixels to use when adding an image to the Media Library', 'wp-graphql' ) ), @@ -160,22 +164,30 @@ function patch_whitelist_options() { 'description' => __( 'Crop thumbnail to exact dimensions (normally thumbnails are proportional)', 'wp-graphql' ) ), 'medium_size_w' => array( - 'show_in_rest' => true, + 'show_in_rest' => array( + 'name' => 'medium_size_width' + ), 'type' => 'integer', 'description' => __( 'Maximum width for medium-sized content in pixels to use when adding an image to the Media Library', 'wp-graphql' ) ), 'medium_size_h' => array( - 'show_in_rest' => true, + 'show_in_rest' => array( + 'name' => 'medium_size_height' + ), 'type' => 'integer', 'description' => __( 'Maximum height for medium-sized content in pixels to use when adding an image to the Media Library', 'wp-graphql' ) ), 'large_size_w' => array( - 'show_in_rest' => true, + 'show_in_rest' => array( + 'name' => 'large_size_width' + ), 'type' => 'integer', 'description' => __( 'Maximum width for large-sized content in pixels to use when adding an image to the Media Library', 'wp-graphql' ) ), 'large_size_h' => array( - 'show_in_rest' => true, + 'show_in_rest' => array( + 'name' => 'large_size_height' + ), 'type' => 'integer', 'description' => __( 'Maximum height for large-sized content in pixels to use when adding an image to the Media Library', 'wp-graphql' ) ), diff --git a/tests/wpunit/PatchSettingsTest.php b/tests/wpunit/PatchSettingsTest.php index 94f1dcf6c..5a2b14d6d 100644 --- a/tests/wpunit/PatchSettingsTest.php +++ b/tests/wpunit/PatchSettingsTest.php @@ -7,12 +7,12 @@ class PatchSettingsTest extends \Codeception\TestCase\WPTestCase public $editor; public $admin; - public function setUp() - { - // before - parent::setUp(); + public function setUp() + { + // before + parent::setUp(); - $this->subscriber = $this->factory->user->create( [ + $this->subscriber = $this->factory->user->create( [ 'role' => 'subscriber', ] ); @@ -27,375 +27,375 @@ public function setUp() $this->admin = $this->factory->user->create( [ 'role' => 'administrator', ] ); - } + } - public function tearDown() - { - // your tear down methods here + public function tearDown() + { + // your tear down methods here - // then - parent::tearDown(); - } + // then + parent::tearDown(); + } - // tests - public function testPatchSettingsQuery() - { - $mock_options = [ + // tests + public function testPatchSettingsQuery() + { + $mock_options = [ 'default_pingback_flag' => 1, - 'default_comment_status' => 'open', - 'comments_notify' => 1, - 'moderation_notify' => 1, - 'comment_moderation' => true, - 'require_name_email' => 1, - 'comment_whitelist' => 1, - 'comment_max_links' => 2, - 'moderation_keys' => 'Yep\nKey\nList', - 'blacklist_keys' => 'Yep\nKey\nList', - 'show_avatars' => 1, - 'avatar_rating' => 'G', - 'avatar_default' => 'mystery', - 'close_comments_for_old_posts' => true, - 'close_comments_days_old' => 14, - 'thread_comments' => 1, - 'thread_comments_depth' => 5, - 'page_comments' => true, - 'default_comments_page' => 'newest', - 'comment_order' => 'asc', - 'comment_registration' => true, - 'show_comments_cookies_opt_in' => false, - 'thumbnail_size_w' => 150, - 'thumbnail_size_h' => 150, - 'thumbnail_crop' => 1, - 'medium_size_w' => 300, - 'medium_size_h' => 300, - 'large_size_w' => 1024, - 'large_size_h' => 1024, - 'posts_per_rss' => 10, - 'rss_use_excerpt' => true, - 'show_on_front' => 'posts', - 'page_on_front' => '1', - 'page_for_posts' => '2', - 'blog_public' => true, - 'default_email_category' => 1, - 'default_link_category' => 2, - 'permalink_structure' => '/archives/%post_id%', - 'category_base' => 'kate', - 'tag_base' => 'boggy', - 'wp_page_for_privacy_policy' => '2' + 'default_comment_status' => 'open', + 'comments_notify' => 1, + 'moderation_notify' => 1, + 'comment_moderation' => true, + 'require_name_email' => 1, + 'comment_whitelist' => 1, + 'comment_max_links' => 2, + 'moderation_keys' => 'Yep\nKey\nList', + 'blacklist_keys' => 'Yep\nKey\nList', + 'show_avatars' => 1, + 'avatar_rating' => 'G', + 'avatar_default' => 'mystery', + 'close_comments_for_old_posts' => true, + 'close_comments_days_old' => 14, + 'thread_comments' => 1, + 'thread_comments_depth' => 5, + 'page_comments' => true, + 'default_comments_page' => 'newest', + 'comment_order' => 'asc', + 'comment_registration' => true, + 'show_comments_cookies_opt_in' => false, + 'thumbnail_size_w' => 150, + 'thumbnail_size_h' => 150, + 'thumbnail_crop' => 1, + 'medium_size_w' => 300, + 'medium_size_h' => 300, + 'large_size_w' => 1024, + 'large_size_h' => 1024, + 'posts_per_rss' => 10, + 'rss_use_excerpt' => true, + 'show_on_front' => 'posts', + 'page_on_front' => '1', + 'page_for_posts' => '2', + 'blog_public' => true, + 'default_email_category' => 1, + 'default_link_category' => 2, + 'permalink_structure' => '/archives/%post_id%', + 'category_base' => 'kate', + 'tag_base' => 'boggy', + 'wp_page_for_privacy_policy' => '2' ]; foreach ( $mock_options as $mock_option_key => $mock_value ) { update_option( $mock_option_key, $mock_value ); - } - - $query = " + } + + $query = " query { - discussionSettings{ - defaultPingbackFlag - defaultCommentStatus - commentsNotify - moderationNotify - commentModeration - requireNameEmail - commentWhitelist - commentMaxLinks - moderationKeys - blacklistKeys - showAvatars - avatarRating - avatarDefault - closeCommentsForOldPosts - closeCommentsDaysOld - threadComments - threadCommentsDepth - pageComments - defaultCommentsPage - commentOrder - commentRegistration - showCommentsCookiesOptIn - } - mediaSettings { - thumbnailSizeW - thumbnailSizeH - thumbnailCrop - mediumSizeW - mediumSizeH - largeSizeW - largeSizeH - } - permalinkSettings{ - structure - categoryBase - tagBase - } - privacySettings{ - page - } - readingSettings { - postsPerRss - rssUseExcerpt - showOnFront - pageOnFront - pageForPosts - blogPublic - } - writingSettings { - defaultEmailCategory - defaultLinkCategory - } - } - "; - $actual = do_graphql_request( $query ); + discussionSettings{ + defaultPingbackFlag + defaultCommentStatus + commentsNotify + moderationNotify + commentModeration + requireNameEmail + commentWhitelist + commentMaxLinks + moderationKeys + blacklistKeys + showAvatars + avatarRating + avatarDefault + closeCommentsForOldPosts + closeCommentsDaysOld + threadComments + threadCommentsDepth + pageComments + defaultCommentsPage + commentOrder + commentRegistration + showCommentsCookiesOptIn + } + mediaSettings { + thumbnailSizeWidth + thumbnailSizeHeight + thumbnailCrop + mediumSizeWidth + mediumSizeHeight + largeSizeWidth + largeSizeHeight + } + permalinkSettings{ + structure + categoryBase + tagBase + } + privacySettings{ + page + } + readingSettings { + postsPerRss + rssUseExcerpt + showOnFront + pageOnFront + pageForPosts + blogPublic + } + writingSettings { + defaultEmailCategory + defaultLinkCategory + } + } + "; + $actual = do_graphql_request( $query ); - $expected = array( - 'data' => array( - 'discussionSettings' => array( - 'defaultPingbackFlag' => 1, - 'defaultCommentStatus' => 'open', - 'commentsNotify' => 1, - 'moderationNotify' => 1, - 'commentModeration' => true, - 'requireNameEmail' => 1, - 'commentWhitelist' => 1, - 'commentMaxLinks' => 2, - 'moderationKeys' => 'Yep\nKey\nList', - 'blacklistKeys' => 'Yep\nKey\nList', - 'showAvatars' => 1, - 'avatarRating' => 'G', - 'avatarDefault' => 'mystery', - 'closeCommentsForOldPosts' => true, - 'closeCommentsDaysOld' => 14, - 'threadComments' => 1, - 'threadCommentsDepth' => 5, - 'pageComments' => true, - 'defaultCommentsPage' => 'newest', - 'commentOrder' => 'asc', - 'commentRegistration' => true, - 'showCommentsCookiesOptIn' => null, - ), - 'mediaSettings' => array( - 'thumbnailSizeW' => 150, - 'thumbnailSizeH' => 150, - 'thumbnailCrop' => 1, - 'mediumSizeW' => 300, - 'mediumSizeH' => 300, - 'largeSizeW' => 1024, - 'largeSizeH' => 1024, - ), - 'permalinkSettings' => array( - 'structure' => '/archives/%post_id%', - 'categoryBase' => 'kate', - 'tagBase' => 'boggy' - ), - 'privacySettings' => array( - 'page' => '2' - ), - 'readingSettings' => array( - 'postsPerRss' => 10, - 'rssUseExcerpt' => '1', - 'showOnFront' => 'posts', - 'pageOnFront' => '1', - 'pageForPosts' => '2', - 'blogPublic' => true, - ), - 'writingSettings' => array( - 'defaultEmailCategory' => 1, - 'defaultLinkCategory' => 2, - ) - ) - ); + $expected = array( + 'data' => array( + 'discussionSettings' => array( + 'defaultPingbackFlag' => 1, + 'defaultCommentStatus' => 'open', + 'commentsNotify' => 1, + 'moderationNotify' => 1, + 'commentModeration' => true, + 'requireNameEmail' => 1, + 'commentWhitelist' => 1, + 'commentMaxLinks' => 2, + 'moderationKeys' => 'Yep\nKey\nList', + 'blacklistKeys' => 'Yep\nKey\nList', + 'showAvatars' => 1, + 'avatarRating' => 'G', + 'avatarDefault' => 'mystery', + 'closeCommentsForOldPosts' => true, + 'closeCommentsDaysOld' => 14, + 'threadComments' => 1, + 'threadCommentsDepth' => 5, + 'pageComments' => true, + 'defaultCommentsPage' => 'newest', + 'commentOrder' => 'asc', + 'commentRegistration' => true, + 'showCommentsCookiesOptIn' => null, + ), + 'mediaSettings' => array( + 'thumbnailSizeWidth' => 150, + 'thumbnailSizeHeight' => 150, + 'thumbnailCrop' => 1, + 'mediumSizeWidth' => 300, + 'mediumSizeHeight' => 300, + 'largeSizeWidth' => 1024, + 'largeSizeHeight' => 1024, + ), + 'permalinkSettings' => array( + 'structure' => '/archives/%post_id%', + 'categoryBase' => 'kate', + 'tagBase' => 'boggy' + ), + 'privacySettings' => array( + 'page' => '2' + ), + 'readingSettings' => array( + 'postsPerRss' => 10, + 'rssUseExcerpt' => '1', + 'showOnFront' => 'posts', + 'pageOnFront' => '1', + 'pageForPosts' => '2', + 'blogPublic' => true, + ), + 'writingSettings' => array( + 'defaultEmailCategory' => 1, + 'defaultLinkCategory' => 2, + ) + ) + ); - /** - * use --debug flag to view - */ - \Codeception\Util\Debug::debug( $actual ); + /** + * use --debug flag to view + */ + \Codeception\Util\Debug::debug( $actual ); - /** + /** * Compare the actual output vs the expected output */ - $this->assertEquals( $actual, $expected ); - } + $this->assertEquals( $actual, $expected ); + } - public function testPatchSettingsMutation() - { - $updateSettingsInput = array( - 'input' => array( - 'clientMutationId' => 'someId', - 'discussionSettingsDefaultPingbackFlag' => true, - 'discussionSettingsDefaultCommentStatus' => 'close', - 'discussionSettingsCommentsNotify' => true, - 'discussionSettingsModerationNotify' => true, - 'discussionSettingsCommentModeration' => true, - 'discussionSettingsRequireNameEmail' => true, - 'discussionSettingsCommentWhitelist' => true, - 'discussionSettingsCommentMaxLinks' => 4, - 'discussionSettingsModerationKeys' => '', - 'discussionSettingsBlacklistKeys' => '', - 'discussionSettingsShowAvatars' => false, - 'discussionSettingsAvatarRating' => 'X', - 'discussionSettingsAvatarDefault' => 'blank', - 'discussionSettingsCloseCommentsForOldPosts' => false, - 'discussionSettingsCloseCommentsDaysOld' => 7, - 'discussionSettingsThreadComments' => true, - 'discussionSettingsThreadCommentsDepth' => 2, - 'discussionSettingsPageComments' => true, - 'discussionSettingsDefaultCommentsPage' => 'oldest', - 'discussionSettingsCommentOrder' => 'desc', - 'discussionSettingsCommentRegistration' => false, - 'discussionSettingsShowCommentsCookiesOptIn' => false, - 'mediaSettingsThumbnailSizeW' => 256, - 'mediaSettingsThumbnailSizeH' => 256, - 'mediaSettingsThumbnailCrop' => true, - 'mediaSettingsMediumSizeW' => 512, - 'mediaSettingsMediumSizeH' => 512, - 'mediaSettingsLargeSizeW' => 1024, - 'mediaSettingsLargeSizeH' => 1024, - 'permalinkSettingsStructure' => '/%year%/%monthnum%/%postname%/', - 'permalinkSettingsCategoryBase' => 'louie', - 'permalinkSettingsTagBase' => 'duck', - 'privacySettingsPage' => '1', - 'readingSettingsPostsPerRss' => 5, - 'readingSettingsRssUseExcerpt' => '0', - 'readingSettingsShowOnFront' => 'page', - 'readingSettingsPageOnFront' => '2', - 'readingSettingsPageForPosts' => '1', - 'readingSettingsBlogPublic' => false, - 'writingSettingsDefaultEmailCategory' => 2, - 'writingSettingsDefaultLinkCategory' => 1 - ) - ); + public function testPatchSettingsMutation() + { + $updateSettingsInput = array( + 'input' => array( + 'clientMutationId' => 'someId', + 'discussionSettingsDefaultPingbackFlag' => true, + 'discussionSettingsDefaultCommentStatus' => 'close', + 'discussionSettingsCommentsNotify' => true, + 'discussionSettingsModerationNotify' => true, + 'discussionSettingsCommentModeration' => true, + 'discussionSettingsRequireNameEmail' => true, + 'discussionSettingsCommentWhitelist' => true, + 'discussionSettingsCommentMaxLinks' => 4, + 'discussionSettingsModerationKeys' => '', + 'discussionSettingsBlacklistKeys' => '', + 'discussionSettingsShowAvatars' => false, + 'discussionSettingsAvatarRating' => 'X', + 'discussionSettingsAvatarDefault' => 'blank', + 'discussionSettingsCloseCommentsForOldPosts' => false, + 'discussionSettingsCloseCommentsDaysOld' => 7, + 'discussionSettingsThreadComments' => true, + 'discussionSettingsThreadCommentsDepth' => 2, + 'discussionSettingsPageComments' => true, + 'discussionSettingsDefaultCommentsPage' => 'oldest', + 'discussionSettingsCommentOrder' => 'desc', + 'discussionSettingsCommentRegistration' => false, + 'discussionSettingsShowCommentsCookiesOptIn' => false, + 'mediaSettingsThumbnailSizeWidth' => 256, + 'mediaSettingsThumbnailSizeHeight' => 256, + 'mediaSettingsThumbnailCrop' => true, + 'mediaSettingsMediumSizeWidth' => 512, + 'mediaSettingsMediumSizeHeight' => 512, + 'mediaSettingsLargeSizeWidth' => 1024, + 'mediaSettingsLargeSizeHeight' => 1024, + 'permalinkSettingsStructure' => '/%year%/%monthnum%/%postname%/', + 'permalinkSettingsCategoryBase' => 'louie', + 'permalinkSettingsTagBase' => 'duck', + 'privacySettingsPage' => '1', + 'readingSettingsPostsPerRss' => 5, + 'readingSettingsRssUseExcerpt' => '0', + 'readingSettingsShowOnFront' => 'page', + 'readingSettingsPageOnFront' => '2', + 'readingSettingsPageForPosts' => '1', + 'readingSettingsBlogPublic' => false, + 'writingSettingsDefaultEmailCategory' => 2, + 'writingSettingsDefaultLinkCategory' => 1 + ) + ); - $mutation = ' - mutation updateSettings( $input: UpdateSettingsInput! ) { - updateSettings( input: $input ) { - clientMutationId - allSettings{ - discussionSettingsDefaultPingbackFlag - discussionSettingsDefaultCommentStatus - discussionSettingsCommentsNotify - discussionSettingsModerationNotify - discussionSettingsCommentModeration - discussionSettingsRequireNameEmail - discussionSettingsCommentWhitelist - discussionSettingsCommentMaxLinks - discussionSettingsModerationKeys - discussionSettingsBlacklistKeys - discussionSettingsShowAvatars - discussionSettingsAvatarRating - discussionSettingsAvatarDefault - discussionSettingsCloseCommentsForOldPosts - discussionSettingsCloseCommentsDaysOld - discussionSettingsThreadComments - discussionSettingsThreadCommentsDepth - discussionSettingsPageComments - discussionSettingsDefaultCommentsPage - discussionSettingsCommentOrder - discussionSettingsCommentRegistration - discussionSettingsShowCommentsCookiesOptIn - mediaSettingsThumbnailSizeW - mediaSettingsThumbnailSizeH - mediaSettingsThumbnailCrop - mediaSettingsMediumSizeW - mediaSettingsMediumSizeH - mediaSettingsLargeSizeW - mediaSettingsLargeSizeH - permalinkSettingsStructure - permalinkSettingsCategoryBase - permalinkSettingsTagBase - privacySettingsPage - readingSettingsPostsPerRss - readingSettingsRssUseExcerpt - readingSettingsShowOnFront - readingSettingsPageOnFront - readingSettingsPageForPosts - readingSettingsBlogPublic - writingSettingsDefaultEmailCategory - writingSettingsDefaultLinkCategory - } - } - } - '; + $mutation = ' + mutation updateSettings( $input: UpdateSettingsInput! ) { + updateSettings( input: $input ) { + clientMutationId + allSettings{ + discussionSettingsDefaultPingbackFlag + discussionSettingsDefaultCommentStatus + discussionSettingsCommentsNotify + discussionSettingsModerationNotify + discussionSettingsCommentModeration + discussionSettingsRequireNameEmail + discussionSettingsCommentWhitelist + discussionSettingsCommentMaxLinks + discussionSettingsModerationKeys + discussionSettingsBlacklistKeys + discussionSettingsShowAvatars + discussionSettingsAvatarRating + discussionSettingsAvatarDefault + discussionSettingsCloseCommentsForOldPosts + discussionSettingsCloseCommentsDaysOld + discussionSettingsThreadComments + discussionSettingsThreadCommentsDepth + discussionSettingsPageComments + discussionSettingsDefaultCommentsPage + discussionSettingsCommentOrder + discussionSettingsCommentRegistration + discussionSettingsShowCommentsCookiesOptIn + mediaSettingsThumbnailSizeWidth + mediaSettingsThumbnailSizeHeight + mediaSettingsThumbnailCrop + mediaSettingsMediumSizeWidth + mediaSettingsMediumSizeHeight + mediaSettingsLargeSizeWidth + mediaSettingsLargeSizeHeight + permalinkSettingsStructure + permalinkSettingsCategoryBase + permalinkSettingsTagBase + privacySettingsPage + readingSettingsPostsPerRss + readingSettingsRssUseExcerpt + readingSettingsShowOnFront + readingSettingsPageOnFront + readingSettingsPageForPosts + readingSettingsBlogPublic + writingSettingsDefaultEmailCategory + writingSettingsDefaultLinkCategory + } + } + } + '; - /** + /** * Set the current user as the subscriber so we can test, and expect to fail */ wp_set_current_user( $this->subscriber ); - $actual = do_graphql_request( $mutation, 'updateSettings', $updateSettingsInput ); + $actual = do_graphql_request( $mutation, 'updateSettings', $updateSettingsInput ); - /** - * use --debug flag to view - */ - \Codeception\Util\Debug::debug( $actual ); + /** + * use --debug flag to view + */ + \Codeception\Util\Debug::debug( $actual ); - $this->assertArrayHasKey( 'errors', $actual ); + $this->assertArrayHasKey( 'errors', $actual ); - /** + /** * Set the current user as the admin so we can test, and expect to pass */ - wp_set_current_user( $this->admin ); - - $actual = do_graphql_request( $mutation, 'updateSettings', $updateSettingsInput ); + wp_set_current_user( $this->admin ); + + $actual = do_graphql_request( $mutation, 'updateSettings', $updateSettingsInput ); - $expected = array( - 'data' => array( - 'updateSettings' => array( - 'clientMutationId' => 'someId', - 'allSettings' => array( - 'discussionSettingsDefaultPingbackFlag' => true, - 'discussionSettingsDefaultCommentStatus' => 'close', - 'discussionSettingsCommentsNotify' => true, - 'discussionSettingsModerationNotify' => true, - 'discussionSettingsCommentModeration' => true, - 'discussionSettingsRequireNameEmail' => true, - 'discussionSettingsCommentWhitelist' => true, - 'discussionSettingsCommentMaxLinks' => 4, - 'discussionSettingsModerationKeys' => '', - 'discussionSettingsBlacklistKeys' => '', - 'discussionSettingsShowAvatars' => false, - 'discussionSettingsAvatarRating' => 'X', - 'discussionSettingsAvatarDefault' => 'blank', - 'discussionSettingsCloseCommentsForOldPosts' => false, - 'discussionSettingsCloseCommentsDaysOld' => 7, - 'discussionSettingsThreadComments' => true, - 'discussionSettingsThreadCommentsDepth' => 2, - 'discussionSettingsPageComments' => true, - 'discussionSettingsDefaultCommentsPage' => 'oldest', - 'discussionSettingsCommentOrder' => 'desc', - 'discussionSettingsCommentRegistration' => false, - 'discussionSettingsShowCommentsCookiesOptIn' => false, - 'mediaSettingsThumbnailSizeW' => 256, - 'mediaSettingsThumbnailSizeH' => 256, - 'mediaSettingsThumbnailCrop' => true, - 'mediaSettingsMediumSizeW' => 512, - 'mediaSettingsMediumSizeH' => 512, - 'mediaSettingsLargeSizeW' => 1024, - 'mediaSettingsLargeSizeH' => 1024, - 'permalinkSettingsStructure' => '/%year%/%monthnum%/%postname%/', - 'permalinkSettingsCategoryBase' => 'louie', - 'permalinkSettingsTagBase' => 'duck', - 'privacySettingsPage' => '1', - 'readingSettingsPostsPerRss' => 5, - 'readingSettingsRssUseExcerpt' => '', - 'readingSettingsShowOnFront' => 'page', - 'readingSettingsPageOnFront' => '2', - 'readingSettingsPageForPosts' => '1', - 'readingSettingsBlogPublic' => false, - 'writingSettingsDefaultEmailCategory' => 2, - 'writingSettingsDefaultLinkCategory' => 1 - ) - ) - ) - ); + $expected = array( + 'data' => array( + 'updateSettings' => array( + 'clientMutationId' => 'someId', + 'allSettings' => array( + 'discussionSettingsDefaultPingbackFlag' => true, + 'discussionSettingsDefaultCommentStatus' => 'close', + 'discussionSettingsCommentsNotify' => true, + 'discussionSettingsModerationNotify' => true, + 'discussionSettingsCommentModeration' => true, + 'discussionSettingsRequireNameEmail' => true, + 'discussionSettingsCommentWhitelist' => true, + 'discussionSettingsCommentMaxLinks' => 4, + 'discussionSettingsModerationKeys' => '', + 'discussionSettingsBlacklistKeys' => '', + 'discussionSettingsShowAvatars' => false, + 'discussionSettingsAvatarRating' => 'X', + 'discussionSettingsAvatarDefault' => 'blank', + 'discussionSettingsCloseCommentsForOldPosts' => false, + 'discussionSettingsCloseCommentsDaysOld' => 7, + 'discussionSettingsThreadComments' => true, + 'discussionSettingsThreadCommentsDepth' => 2, + 'discussionSettingsPageComments' => true, + 'discussionSettingsDefaultCommentsPage' => 'oldest', + 'discussionSettingsCommentOrder' => 'desc', + 'discussionSettingsCommentRegistration' => false, + 'discussionSettingsShowCommentsCookiesOptIn' => false, + 'mediaSettingsThumbnailSizeWidth' => 256, + 'mediaSettingsThumbnailSizeHeight' => 256, + 'mediaSettingsThumbnailCrop' => true, + 'mediaSettingsMediumSizeWidth' => 512, + 'mediaSettingsMediumSizeHeight' => 512, + 'mediaSettingsLargeSizeWidth' => 1024, + 'mediaSettingsLargeSizeHeight' => 1024, + 'permalinkSettingsStructure' => '/%year%/%monthnum%/%postname%/', + 'permalinkSettingsCategoryBase' => 'louie', + 'permalinkSettingsTagBase' => 'duck', + 'privacySettingsPage' => '1', + 'readingSettingsPostsPerRss' => 5, + 'readingSettingsRssUseExcerpt' => '', + 'readingSettingsShowOnFront' => 'page', + 'readingSettingsPageOnFront' => '2', + 'readingSettingsPageForPosts' => '1', + 'readingSettingsBlogPublic' => false, + 'writingSettingsDefaultEmailCategory' => 2, + 'writingSettingsDefaultLinkCategory' => 1 + ) + ) + ) + ); - /** - * use --debug flag to view - */ - \Codeception\Util\Debug::debug( $actual ); + /** + * use --debug flag to view + */ + \Codeception\Util\Debug::debug( $actual ); - /** + /** * Compare the actual output vs the expected output */ - $this->assertEquals( $actual, $expected ); - } + $this->assertEquals( $actual, $expected ); + } } \ No newline at end of file From 1b5351827f09554fd0a9162bf426e13021e946a1 Mon Sep 17 00:00:00 2001 From: Geoffrey K Taylor Date: Thu, 7 Mar 2019 20:48:25 -0500 Subject: [PATCH 6/7] page_for_posts_slug field added --- settings-patch.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/settings-patch.php b/settings-patch.php index b70898924..55ec9ccb8 100644 --- a/settings-patch.php +++ b/settings-patch.php @@ -277,6 +277,12 @@ function patch_whitelist_options() { 'type' => 'string', 'description' => __( 'WP Page ID of blog page', 'wp-graphql' ) ), + 'page_for_posts_slug' => array( + 'show_in_rest' => true, + 'type' => 'string', + 'description' => __( 'WP Page ID of blog page', 'wp-graphql' ), + 'default' => get_page_uri( get_option( 'page_for_posts', '' ) ) + ), 'blog_public' => array( 'show_in_rest' => true, 'type' => 'boolean', @@ -308,4 +314,4 @@ function patch_whitelist_options() { } - add_action( 'graphql_init', 'patch_whitelist_options', 1 ); \ No newline at end of file + add_action( 'graphql_init', 'patch_whitelist_options', 1 ); From 7f89d7003fb364e33ebdb4d8e07b598795056abb Mon Sep 17 00:00:00 2001 From: Geoffrey K Taylor Date: Thu, 7 Mar 2019 20:50:06 -0500 Subject: [PATCH 7/7] Update settings-patch.php --- settings-patch.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/settings-patch.php b/settings-patch.php index 55ec9ccb8..343a58191 100644 --- a/settings-patch.php +++ b/settings-patch.php @@ -280,7 +280,7 @@ function patch_whitelist_options() { 'page_for_posts_slug' => array( 'show_in_rest' => true, 'type' => 'string', - 'description' => __( 'WP Page ID of blog page', 'wp-graphql' ), + 'description' => __( 'WP slug of blog page', 'wp-graphql' ), 'default' => get_page_uri( get_option( 'page_for_posts', '' ) ) ), 'blog_public' => array(