From eabe31a4964646d818dd4fdf69179a529bc7a0c7 Mon Sep 17 00:00:00 2001 From: David Levine Date: Wed, 12 Jun 2024 15:32:57 +0000 Subject: [PATCH] chore: update deps, backfill tests, cleanup readme links --- CHANGELOG.md | 1 + README.md | 4 +- composer.lock | 273 +++++++++--------- .../FormFieldConnectionPageFilterTest.php | 14 +- tests/wpunit/GFUtilsTest.php | 75 ++++- tests/wpunit/RadioFieldOtherChoiceTest.php | 18 +- tests/wpunit/SubmitFormMultipageTest.php | 60 ++-- vendor/composer/installed.php | 4 +- 8 files changed, 262 insertions(+), 187 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f83b5395..d6abfdb8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,7 @@ - chore: Declare `strict_types` in all PHP files. - chore: Update Composer dev-dependencies and fix test compatibility with `wp-graphql-test-case` v3.0.x. - docs: Add docs on using Multi-page forms. +- tests: Add test for `GFUtils::get_last_form_page()`. ## v0.12.6.1 diff --git a/README.md b/README.md index dabc3d6d..3da275f3 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ A WordPress plugin that adds WPGraphQL support for Gravity Forms. -* [Join the WPGraphQL community on Slack.](https://join.slack.com/t/wp-graphql/shared_invite/zt-3vloo60z-PpJV2PFIwEathWDOxCTTLA) +* [Join the WPGraphQL community on Discord.](https://discord.gg/Hp6fQbqvwe) * [Documentation](#documentation) ----- @@ -58,7 +58,7 @@ v0.x.y.z: "Patch" releases. These releases are reserved for addressing issue wit Development of WPGraphQL for Gravity Forms is provided by [AxePress Development](https://axepress.dev). Community contributions are _welcome_ and **encouraged**. -Basic support is provided for free, both in [this repo](https://github.com/axewp/wp-graphql-gravity-forms/issues) and in [WPGraphQL Slack](https://join.slack.com/t/wp-graphql/shared_invite/zt-3vloo60z-PpJV2PFIwEathWDOxCTTLA). +Basic support is provided for free, both in [this repo](https://github.com/axewp/wp-graphql-gravity-forms/issues) and in [WPGraphQL's official Discord](https://discord.gg/Hp6fQbqvwe). Priority support and custom development are available to [our Sponsors](https://github.com/sponsors/AxeWP). diff --git a/composer.lock b/composer.lock index 0e9a6c84..7b9c4376 100644 --- a/composer.lock +++ b/composer.lock @@ -220,16 +220,16 @@ }, { "name": "axepress/wp-graphql-stubs", - "version": "v1.26.0", + "version": "v1.27.0", "source": { "type": "git", "url": "https://github.com/AxeWP/wp-graphql-stubs.git", - "reference": "e7ff2d60bba3353a0ad14fea39bf72e149643f00" + "reference": "fe3c1fbdfd740e9755f743b0994c79189587623f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/AxeWP/wp-graphql-stubs/zipball/e7ff2d60bba3353a0ad14fea39bf72e149643f00", - "reference": "e7ff2d60bba3353a0ad14fea39bf72e149643f00", + "url": "https://api.github.com/repos/AxeWP/wp-graphql-stubs/zipball/fe3c1fbdfd740e9755f743b0994c79189587623f", + "reference": "fe3c1fbdfd740e9755f743b0994c79189587623f", "shasum": "" }, "require": { @@ -260,7 +260,7 @@ ], "support": { "issues": "https://github.com/AxeWP/wp-graphql-stubs/issues", - "source": "https://github.com/AxeWP/wp-graphql-stubs/tree/v1.26.0" + "source": "https://github.com/AxeWP/wp-graphql-stubs/tree/v1.27.0" }, "funding": [ { @@ -268,7 +268,7 @@ "type": "github" } ], - "time": "2024-05-10T12:33:59+00:00" + "time": "2024-06-06T01:23:23+00:00" }, { "name": "behat/gherkin", @@ -1250,16 +1250,16 @@ }, { "name": "composer/class-map-generator", - "version": "1.3.2", + "version": "1.3.4", "source": { "type": "git", "url": "https://github.com/composer/class-map-generator.git", - "reference": "acd227952154850d0bb7d65caa4f9edf9cd806a7" + "reference": "b1b3fd0b4eaf3ddf3ee230bc340bf3fff454a1a3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/class-map-generator/zipball/acd227952154850d0bb7d65caa4f9edf9cd806a7", - "reference": "acd227952154850d0bb7d65caa4f9edf9cd806a7", + "url": "https://api.github.com/repos/composer/class-map-generator/zipball/b1b3fd0b4eaf3ddf3ee230bc340bf3fff454a1a3", + "reference": "b1b3fd0b4eaf3ddf3ee230bc340bf3fff454a1a3", "shasum": "" }, "require": { @@ -1303,7 +1303,7 @@ ], "support": { "issues": "https://github.com/composer/class-map-generator/issues", - "source": "https://github.com/composer/class-map-generator/tree/1.3.2" + "source": "https://github.com/composer/class-map-generator/tree/1.3.4" }, "funding": [ { @@ -1319,28 +1319,28 @@ "type": "tidelift" } ], - "time": "2024-05-31T19:45:56+00:00" + "time": "2024-06-12T14:13:04+00:00" }, { "name": "composer/composer", - "version": "2.7.6", + "version": "2.7.7", "source": { "type": "git", "url": "https://github.com/composer/composer.git", - "reference": "fabd995783b633829fd4280e272284b39b6ae702" + "reference": "291942978f39435cf904d33739f98d7d4eca7b23" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/composer/zipball/fabd995783b633829fd4280e272284b39b6ae702", - "reference": "fabd995783b633829fd4280e272284b39b6ae702", + "url": "https://api.github.com/repos/composer/composer/zipball/291942978f39435cf904d33739f98d7d4eca7b23", + "reference": "291942978f39435cf904d33739f98d7d4eca7b23", "shasum": "" }, "require": { "composer/ca-bundle": "^1.0", - "composer/class-map-generator": "^1.0", + "composer/class-map-generator": "^1.3.3", "composer/metadata-minifier": "^1.0", "composer/pcre": "^2.1 || ^3.1", - "composer/semver": "^3.2.5", + "composer/semver": "^3.3", "composer/spdx-licenses": "^1.5.7", "composer/xdebug-handler": "^2.0.2 || ^3.0.3", "justinrainbow/json-schema": "^5.2.11", @@ -1359,11 +1359,11 @@ "symfony/process": "^5.4 || ^6.0 || ^7" }, "require-dev": { - "phpstan/phpstan": "^1.9.3", - "phpstan/phpstan-deprecation-rules": "^1", - "phpstan/phpstan-phpunit": "^1.0", - "phpstan/phpstan-strict-rules": "^1", - "phpstan/phpstan-symfony": "^1.2.10", + "phpstan/phpstan": "^1.11.0", + "phpstan/phpstan-deprecation-rules": "^1.2.0", + "phpstan/phpstan-phpunit": "^1.4.0", + "phpstan/phpstan-strict-rules": "^1.6.0", + "phpstan/phpstan-symfony": "^1.4.0", "symfony/phpunit-bridge": "^6.4.1 || ^7.0.1" }, "suggest": { @@ -1417,7 +1417,7 @@ "irc": "ircs://irc.libera.chat:6697/composer", "issues": "https://github.com/composer/composer/issues", "security": "https://github.com/composer/composer/security/policy", - "source": "https://github.com/composer/composer/tree/2.7.6" + "source": "https://github.com/composer/composer/tree/2.7.7" }, "funding": [ { @@ -1433,7 +1433,7 @@ "type": "tidelift" } ], - "time": "2024-05-04T21:03:15+00:00" + "time": "2024-06-10T20:11:12+00:00" }, { "name": "composer/metadata-minifier", @@ -3231,16 +3231,16 @@ }, { "name": "myclabs/deep-copy", - "version": "1.11.1", + "version": "1.12.0", "source": { "type": "git", "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "7284c22080590fb39f2ffa3e9057f10a4ddd0e0c" + "reference": "3a6b9a42cd8f8771bd4295d13e1423fa7f3d942c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/7284c22080590fb39f2ffa3e9057f10a4ddd0e0c", - "reference": "7284c22080590fb39f2ffa3e9057f10a4ddd0e0c", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/3a6b9a42cd8f8771bd4295d13e1423fa7f3d942c", + "reference": "3a6b9a42cd8f8771bd4295d13e1423fa7f3d942c", "shasum": "" }, "require": { @@ -3248,11 +3248,12 @@ }, "conflict": { "doctrine/collections": "<1.6.8", - "doctrine/common": "<2.13.3 || >=3,<3.2.2" + "doctrine/common": "<2.13.3 || >=3 <3.2.2" }, "require-dev": { "doctrine/collections": "^1.6.8", "doctrine/common": "^2.13.3 || ^3.2.2", + "phpspec/prophecy": "^1.10", "phpunit/phpunit": "^7.5.20 || ^8.5.23 || ^9.5.13" }, "type": "library", @@ -3278,7 +3279,7 @@ ], "support": { "issues": "https://github.com/myclabs/DeepCopy/issues", - "source": "https://github.com/myclabs/DeepCopy/tree/1.11.1" + "source": "https://github.com/myclabs/DeepCopy/tree/1.12.0" }, "funding": [ { @@ -3286,7 +3287,7 @@ "type": "tidelift" } ], - "time": "2023-03-08T13:26:56+00:00" + "time": "2024-06-12T14:39:25+00:00" }, { "name": "nb/oxymel", @@ -3335,16 +3336,16 @@ }, { "name": "nesbot/carbon", - "version": "2.72.3", + "version": "2.72.5", "source": { "type": "git", "url": "https://github.com/briannesbitt/Carbon.git", - "reference": "0c6fd108360c562f6e4fd1dedb8233b423e91c83" + "reference": "afd46589c216118ecd48ff2b95d77596af1e57ed" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/0c6fd108360c562f6e4fd1dedb8233b423e91c83", - "reference": "0c6fd108360c562f6e4fd1dedb8233b423e91c83", + "url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/afd46589c216118ecd48ff2b95d77596af1e57ed", + "reference": "afd46589c216118ecd48ff2b95d77596af1e57ed", "shasum": "" }, "require": { @@ -3378,8 +3379,8 @@ "type": "library", "extra": { "branch-alias": { - "dev-3.x": "3.x-dev", - "dev-master": "2.x-dev" + "dev-master": "3.x-dev", + "dev-2.x": "2.x-dev" }, "laravel": { "providers": [ @@ -3438,7 +3439,7 @@ "type": "tidelift" } ], - "time": "2024-01-25T10:35:09+00:00" + "time": "2024-06-03T19:18:41+00:00" }, { "name": "nikic/php-parser", @@ -3875,18 +3876,18 @@ "source": { "type": "git", "url": "https://github.com/PHPCompatibility/PHPCompatibility.git", - "reference": "96072c30924c80d20d74f1762cfd706754b17638" + "reference": "5a0ad8d5abab6fc6898a3d7d4f804729229e3962" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibility/zipball/96072c30924c80d20d74f1762cfd706754b17638", - "reference": "96072c30924c80d20d74f1762cfd706754b17638", + "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibility/zipball/5a0ad8d5abab6fc6898a3d7d4f804729229e3962", + "reference": "5a0ad8d5abab6fc6898a3d7d4f804729229e3962", "shasum": "" }, "require": { "php": ">=5.4", - "phpcsstandards/phpcsutils": "^1.0.9", - "squizlabs/php_codesniffer": "^3.9.0" + "phpcsstandards/phpcsutils": "^1.0.12", + "squizlabs/php_codesniffer": "^3.10.0" }, "replace": { "wimg/php-compatibility": "*" @@ -3957,7 +3958,7 @@ "type": "open_collective" } ], - "time": "2024-04-30T23:24:59+00:00" + "time": "2024-06-07T09:46:11+00:00" }, { "name": "phpcompatibility/phpcompatibility-paragonie", @@ -4269,16 +4270,16 @@ }, { "name": "phpstan/extension-installer", - "version": "1.3.1", + "version": "1.4.1", "source": { "type": "git", "url": "https://github.com/phpstan/extension-installer.git", - "reference": "f45734bfb9984c6c56c4486b71230355f066a58a" + "reference": "f6b87faf9fc7978eab2f7919a8760bc9f58f9203" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/extension-installer/zipball/f45734bfb9984c6c56c4486b71230355f066a58a", - "reference": "f45734bfb9984c6c56c4486b71230355f066a58a", + "url": "https://api.github.com/repos/phpstan/extension-installer/zipball/f6b87faf9fc7978eab2f7919a8760bc9f58f9203", + "reference": "f6b87faf9fc7978eab2f7919a8760bc9f58f9203", "shasum": "" }, "require": { @@ -4307,9 +4308,9 @@ "description": "Composer plugin for automatic installation of PHPStan extensions", "support": { "issues": "https://github.com/phpstan/extension-installer/issues", - "source": "https://github.com/phpstan/extension-installer/tree/1.3.1" + "source": "https://github.com/phpstan/extension-installer/tree/1.4.1" }, - "time": "2023-05-24T08:59:17+00:00" + "time": "2024-06-10T08:20:49+00:00" }, { "name": "phpstan/phpdoc-parser", @@ -4360,16 +4361,16 @@ }, { "name": "phpstan/phpstan", - "version": "1.11.3", + "version": "1.11.4", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan.git", - "reference": "e64220a05c1209fc856d58e789c3b7a32c0bb9a5" + "reference": "9100a76ce8015b9aa7125b9171ae3a76887b6c82" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/e64220a05c1209fc856d58e789c3b7a32c0bb9a5", - "reference": "e64220a05c1209fc856d58e789c3b7a32c0bb9a5", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/9100a76ce8015b9aa7125b9171ae3a76887b6c82", + "reference": "9100a76ce8015b9aa7125b9171ae3a76887b6c82", "shasum": "" }, "require": { @@ -4414,7 +4415,7 @@ "type": "github" } ], - "time": "2024-05-31T13:53:37+00:00" + "time": "2024-06-06T12:19:22+00:00" }, { "name": "phpunit/php-code-coverage", @@ -6772,16 +6773,16 @@ }, { "name": "symfony/browser-kit", - "version": "v5.4.39", + "version": "v5.4.40", "source": { "type": "git", "url": "https://github.com/symfony/browser-kit.git", - "reference": "4c5d1a88ceee2b1c5c0b400b0137989ec34f70fa" + "reference": "92c8ba1e5ee12d07120744c90898516132b4e58b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/browser-kit/zipball/4c5d1a88ceee2b1c5c0b400b0137989ec34f70fa", - "reference": "4c5d1a88ceee2b1c5c0b400b0137989ec34f70fa", + "url": "https://api.github.com/repos/symfony/browser-kit/zipball/92c8ba1e5ee12d07120744c90898516132b4e58b", + "reference": "92c8ba1e5ee12d07120744c90898516132b4e58b", "shasum": "" }, "require": { @@ -6824,7 +6825,7 @@ "description": "Simulates the behavior of a web browser, allowing you to make requests, click on links and submit forms programmatically", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/browser-kit/tree/v5.4.39" + "source": "https://github.com/symfony/browser-kit/tree/v5.4.40" }, "funding": [ { @@ -6840,20 +6841,20 @@ "type": "tidelift" } ], - "time": "2024-04-18T08:26:06+00:00" + "time": "2024-05-31T14:33:22+00:00" }, { "name": "symfony/config", - "version": "v5.4.39", + "version": "v5.4.40", "source": { "type": "git", "url": "https://github.com/symfony/config.git", - "reference": "62cec4a067931552624a9962002c210c502d42fd" + "reference": "d4e1db78421163b98dd9971d247fd0df4a57ee5e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/config/zipball/62cec4a067931552624a9962002c210c502d42fd", - "reference": "62cec4a067931552624a9962002c210c502d42fd", + "url": "https://api.github.com/repos/symfony/config/zipball/d4e1db78421163b98dd9971d247fd0df4a57ee5e", + "reference": "d4e1db78421163b98dd9971d247fd0df4a57ee5e", "shasum": "" }, "require": { @@ -6903,7 +6904,7 @@ "description": "Helps you find, load, combine, autofill and validate configuration values of any kind", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/config/tree/v5.4.39" + "source": "https://github.com/symfony/config/tree/v5.4.40" }, "funding": [ { @@ -6919,20 +6920,20 @@ "type": "tidelift" } ], - "time": "2024-04-18T08:26:06+00:00" + "time": "2024-05-31T14:33:22+00:00" }, { "name": "symfony/console", - "version": "v5.4.39", + "version": "v5.4.40", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "f3e591c48688a0cfa1a3296205926c05e84b22b1" + "reference": "aa73115c0c24220b523625bfcfa655d7d73662dd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/f3e591c48688a0cfa1a3296205926c05e84b22b1", - "reference": "f3e591c48688a0cfa1a3296205926c05e84b22b1", + "url": "https://api.github.com/repos/symfony/console/zipball/aa73115c0c24220b523625bfcfa655d7d73662dd", + "reference": "aa73115c0c24220b523625bfcfa655d7d73662dd", "shasum": "" }, "require": { @@ -7002,7 +7003,7 @@ "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v5.4.39" + "source": "https://github.com/symfony/console/tree/v5.4.40" }, "funding": [ { @@ -7018,20 +7019,20 @@ "type": "tidelift" } ], - "time": "2024-04-18T08:26:06+00:00" + "time": "2024-05-31T14:33:22+00:00" }, { "name": "symfony/css-selector", - "version": "v5.4.39", + "version": "v5.4.40", "source": { "type": "git", "url": "https://github.com/symfony/css-selector.git", - "reference": "0934c9f1d433776f25c629bdc93f3e157d139e08" + "reference": "ea43887e9afd2029509662d4f95e8b5ef6fc9bbb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/css-selector/zipball/0934c9f1d433776f25c629bdc93f3e157d139e08", - "reference": "0934c9f1d433776f25c629bdc93f3e157d139e08", + "url": "https://api.github.com/repos/symfony/css-selector/zipball/ea43887e9afd2029509662d4f95e8b5ef6fc9bbb", + "reference": "ea43887e9afd2029509662d4f95e8b5ef6fc9bbb", "shasum": "" }, "require": { @@ -7068,7 +7069,7 @@ "description": "Converts CSS selectors to XPath expressions", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/css-selector/tree/v5.4.39" + "source": "https://github.com/symfony/css-selector/tree/v5.4.40" }, "funding": [ { @@ -7084,7 +7085,7 @@ "type": "tidelift" } ], - "time": "2024-04-18T08:26:06+00:00" + "time": "2024-05-31T14:33:22+00:00" }, { "name": "symfony/deprecation-contracts", @@ -7155,16 +7156,16 @@ }, { "name": "symfony/dom-crawler", - "version": "v5.4.39", + "version": "v5.4.40", "source": { "type": "git", "url": "https://github.com/symfony/dom-crawler.git", - "reference": "1dffb111b038412b028caba029240e379fda85b2" + "reference": "2ad469c3e07fdba677b278d0e266071a51aa0dac" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/dom-crawler/zipball/1dffb111b038412b028caba029240e379fda85b2", - "reference": "1dffb111b038412b028caba029240e379fda85b2", + "url": "https://api.github.com/repos/symfony/dom-crawler/zipball/2ad469c3e07fdba677b278d0e266071a51aa0dac", + "reference": "2ad469c3e07fdba677b278d0e266071a51aa0dac", "shasum": "" }, "require": { @@ -7210,7 +7211,7 @@ "description": "Eases DOM navigation for HTML and XML documents", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/dom-crawler/tree/v5.4.39" + "source": "https://github.com/symfony/dom-crawler/tree/v5.4.40" }, "funding": [ { @@ -7226,20 +7227,20 @@ "type": "tidelift" } ], - "time": "2024-04-18T08:26:06+00:00" + "time": "2024-05-31T14:33:22+00:00" }, { "name": "symfony/event-dispatcher", - "version": "v5.4.39", + "version": "v5.4.40", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "d40fae9fd85c762b6ba378152fdd1157a85d7e4f" + "reference": "a54e2a8a114065f31020d6a89ede83e34c3b27a4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/d40fae9fd85c762b6ba378152fdd1157a85d7e4f", - "reference": "d40fae9fd85c762b6ba378152fdd1157a85d7e4f", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/a54e2a8a114065f31020d6a89ede83e34c3b27a4", + "reference": "a54e2a8a114065f31020d6a89ede83e34c3b27a4", "shasum": "" }, "require": { @@ -7295,7 +7296,7 @@ "description": "Provides tools that allow your application components to communicate with each other by dispatching events and listening to them", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/event-dispatcher/tree/v5.4.39" + "source": "https://github.com/symfony/event-dispatcher/tree/v5.4.40" }, "funding": [ { @@ -7311,7 +7312,7 @@ "type": "tidelift" } ], - "time": "2024-04-18T08:26:06+00:00" + "time": "2024-05-31T14:33:22+00:00" }, { "name": "symfony/event-dispatcher-contracts", @@ -7394,23 +7395,25 @@ }, { "name": "symfony/filesystem", - "version": "v5.4.39", + "version": "v5.4.40", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "e6edd875d5d39b03de51f3c3951148cfa79a4d12" + "reference": "26dd9912df6940810ea00f8f53ad48d6a3424995" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/e6edd875d5d39b03de51f3c3951148cfa79a4d12", - "reference": "e6edd875d5d39b03de51f3c3951148cfa79a4d12", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/26dd9912df6940810ea00f8f53ad48d6a3424995", + "reference": "26dd9912df6940810ea00f8f53ad48d6a3424995", "shasum": "" }, "require": { "php": ">=7.2.5", "symfony/polyfill-ctype": "~1.8", "symfony/polyfill-mbstring": "~1.8", - "symfony/polyfill-php80": "^1.16", + "symfony/polyfill-php80": "^1.16" + }, + "require-dev": { "symfony/process": "^5.4|^6.4" }, "type": "library", @@ -7439,7 +7442,7 @@ "description": "Provides basic utilities for the filesystem", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/filesystem/tree/v5.4.39" + "source": "https://github.com/symfony/filesystem/tree/v5.4.40" }, "funding": [ { @@ -7455,20 +7458,20 @@ "type": "tidelift" } ], - "time": "2024-04-18T08:26:06+00:00" + "time": "2024-05-31T14:33:22+00:00" }, { "name": "symfony/finder", - "version": "v5.4.39", + "version": "v5.4.40", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "f6a96e4fcd468a25fede16ee665f50ced856bd0a" + "reference": "f51cff4687547641c7d8180d74932ab40b2205ce" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/f6a96e4fcd468a25fede16ee665f50ced856bd0a", - "reference": "f6a96e4fcd468a25fede16ee665f50ced856bd0a", + "url": "https://api.github.com/repos/symfony/finder/zipball/f51cff4687547641c7d8180d74932ab40b2205ce", + "reference": "f51cff4687547641c7d8180d74932ab40b2205ce", "shasum": "" }, "require": { @@ -7502,7 +7505,7 @@ "description": "Finds files and directories via an intuitive fluent interface", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/finder/tree/v5.4.39" + "source": "https://github.com/symfony/finder/tree/v5.4.40" }, "funding": [ { @@ -7518,7 +7521,7 @@ "type": "tidelift" } ], - "time": "2024-04-18T08:26:06+00:00" + "time": "2024-05-31T14:33:22+00:00" }, { "name": "symfony/polyfill-ctype", @@ -8072,16 +8075,16 @@ }, { "name": "symfony/process", - "version": "v5.4.39", + "version": "v5.4.40", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "85a554acd7c28522241faf2e97b9541247a0d3d5" + "reference": "deedcb3bb4669cae2148bc920eafd2b16dc7c046" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/85a554acd7c28522241faf2e97b9541247a0d3d5", - "reference": "85a554acd7c28522241faf2e97b9541247a0d3d5", + "url": "https://api.github.com/repos/symfony/process/zipball/deedcb3bb4669cae2148bc920eafd2b16dc7c046", + "reference": "deedcb3bb4669cae2148bc920eafd2b16dc7c046", "shasum": "" }, "require": { @@ -8114,7 +8117,7 @@ "description": "Executes commands in sub-processes", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/process/tree/v5.4.39" + "source": "https://github.com/symfony/process/tree/v5.4.40" }, "funding": [ { @@ -8130,7 +8133,7 @@ "type": "tidelift" } ], - "time": "2024-04-18T08:26:06+00:00" + "time": "2024-05-31T14:33:22+00:00" }, { "name": "symfony/service-contracts", @@ -8217,16 +8220,16 @@ }, { "name": "symfony/stopwatch", - "version": "v5.4.39", + "version": "v5.4.40", "source": { "type": "git", "url": "https://github.com/symfony/stopwatch.git", - "reference": "fb97497490bcec8a3c32c809cacfdd4c15dc8390" + "reference": "0e9daf3b7c805c747638b2cc48f1649e594f9625" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/stopwatch/zipball/fb97497490bcec8a3c32c809cacfdd4c15dc8390", - "reference": "fb97497490bcec8a3c32c809cacfdd4c15dc8390", + "url": "https://api.github.com/repos/symfony/stopwatch/zipball/0e9daf3b7c805c747638b2cc48f1649e594f9625", + "reference": "0e9daf3b7c805c747638b2cc48f1649e594f9625", "shasum": "" }, "require": { @@ -8259,7 +8262,7 @@ "description": "Provides a way to profile code", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/stopwatch/tree/v5.4.39" + "source": "https://github.com/symfony/stopwatch/tree/v5.4.40" }, "funding": [ { @@ -8275,20 +8278,20 @@ "type": "tidelift" } ], - "time": "2024-04-18T08:26:06+00:00" + "time": "2024-05-31T14:33:22+00:00" }, { "name": "symfony/string", - "version": "v5.4.39", + "version": "v5.4.40", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "495e71bae5862308051b9e63cc3e34078eed83ef" + "reference": "142877285aa974a6f7685e292ab5ba9aae86b143" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/495e71bae5862308051b9e63cc3e34078eed83ef", - "reference": "495e71bae5862308051b9e63cc3e34078eed83ef", + "url": "https://api.github.com/repos/symfony/string/zipball/142877285aa974a6f7685e292ab5ba9aae86b143", + "reference": "142877285aa974a6f7685e292ab5ba9aae86b143", "shasum": "" }, "require": { @@ -8345,7 +8348,7 @@ "utf8" ], "support": { - "source": "https://github.com/symfony/string/tree/v5.4.39" + "source": "https://github.com/symfony/string/tree/v5.4.40" }, "funding": [ { @@ -8361,20 +8364,20 @@ "type": "tidelift" } ], - "time": "2024-04-18T08:26:06+00:00" + "time": "2024-05-31T14:33:22+00:00" }, { "name": "symfony/translation", - "version": "v5.4.39", + "version": "v5.4.40", "source": { "type": "git", "url": "https://github.com/symfony/translation.git", - "reference": "0fabede35e3985c4f96089edeeefe8313e15ca3a" + "reference": "bb51d7f183756d1ac03f50ea47dc5726518cc7e8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/translation/zipball/0fabede35e3985c4f96089edeeefe8313e15ca3a", - "reference": "0fabede35e3985c4f96089edeeefe8313e15ca3a", + "url": "https://api.github.com/repos/symfony/translation/zipball/bb51d7f183756d1ac03f50ea47dc5726518cc7e8", + "reference": "bb51d7f183756d1ac03f50ea47dc5726518cc7e8", "shasum": "" }, "require": { @@ -8442,7 +8445,7 @@ "description": "Provides tools to internationalize your application", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/translation/tree/v5.4.39" + "source": "https://github.com/symfony/translation/tree/v5.4.40" }, "funding": [ { @@ -8458,7 +8461,7 @@ "type": "tidelift" } ], - "time": "2024-04-18T08:26:06+00:00" + "time": "2024-05-31T14:33:22+00:00" }, { "name": "symfony/translation-contracts", @@ -8540,16 +8543,16 @@ }, { "name": "symfony/yaml", - "version": "v5.4.39", + "version": "v5.4.40", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "bc780e16879000f77a1022163c052f5323b5e640" + "reference": "81cad0ceab3d61fe14fe941ff18a230ac9c80f83" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/bc780e16879000f77a1022163c052f5323b5e640", - "reference": "bc780e16879000f77a1022163c052f5323b5e640", + "url": "https://api.github.com/repos/symfony/yaml/zipball/81cad0ceab3d61fe14fe941ff18a230ac9c80f83", + "reference": "81cad0ceab3d61fe14fe941ff18a230ac9c80f83", "shasum": "" }, "require": { @@ -8595,7 +8598,7 @@ "description": "Loads and dumps YAML files", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/yaml/tree/v5.4.39" + "source": "https://github.com/symfony/yaml/tree/v5.4.40" }, "funding": [ { @@ -8611,7 +8614,7 @@ "type": "tidelift" } ], - "time": "2024-04-23T11:57:27+00:00" + "time": "2024-05-31T14:33:22+00:00" }, { "name": "szepeviktor/phpstan-wordpress", diff --git a/tests/wpunit/FormFieldConnectionPageFilterTest.php b/tests/wpunit/FormFieldConnectionPageFilterTest.php index f6d61283..26b743d1 100644 --- a/tests/wpunit/FormFieldConnectionPageFilterTest.php +++ b/tests/wpunit/FormFieldConnectionPageFilterTest.php @@ -46,7 +46,7 @@ public function tearDown(): void { } private function generate_form_pages( int $count = 1 ): array { - $fields = []; + $fields = []; $field_id = 1; for ( $i = 0; $i < $count; $i++ ) { @@ -137,12 +137,12 @@ public function testFilterByPageNumber(): void { * Test with empty offset. */ $variables = [ - 'formId' => $this->form_id, + 'formId' => $this->form_id, 'pageNumber' => 0, ]; $expected = $wp_query; - $actual = $this->graphql( compact( 'query', 'variables' ) ); + $actual = $this->graphql( compact( 'query', 'variables' ) ); $this->assertResponseIsValid( $actual ); $this->assertArrayNotHasKey( 'errors', $actual ); @@ -170,7 +170,6 @@ public function testFilterByPageNumber(): void { $this->assertValidPageFields( $expected, $actual ); - /** * Test the last two results. */ @@ -198,14 +197,15 @@ private function assertValidPageFields( array $expected, array $actual ): void { $this->assertArrayHasKey( 'data', $actual ); $this->assertCount( 2, $actual['data']['gfForm']['formFields']['nodes'] ); - $this->assertEquals( $expected[0]['id'], $actual['data']['gfForm']['formFields']['nodes'][0]['databaseId'] ); $this->assertEquals( $expected[0]['pageNumber'], $actual['data']['gfForm']['formFields']['nodes'][0]['pageNumber'] ); $this->assertEquals( $expected[1]['id'], $actual['data']['gfForm']['formFields']['nodes'][1]['databaseId'] ); $this->assertEquals( $expected[1]['pageNumber'], $actual['data']['gfForm']['formFields']['nodes'][1]['pageNumber'] ); $this->assertEquals( GFHelpers::get_enum_for_value( FormFieldTypeEnum::$type, $expected[1]['type'] ), $actual['data']['gfForm']['formFields']['nodes'][1]['type'] ); $this->assertEquals( $expected[1]['nextButton']['text'], $actual['data']['gfForm']['formFields']['nodes'][1]['nextButton']['text'] ); - $this->assertEquals( - $expected[1]['previousButton']['text'], $actual['data']['gfForm']['formFields']['nodes'][1]['previousButton']['text'] ); + $this->assertEquals( + $expected[1]['previousButton']['text'], + $actual['data']['gfForm']['formFields']['nodes'][1]['previousButton']['text'] + ); } } diff --git a/tests/wpunit/GFUtilsTest.php b/tests/wpunit/GFUtilsTest.php index 9e115746..8357abd3 100644 --- a/tests/wpunit/GFUtilsTest.php +++ b/tests/wpunit/GFUtilsTest.php @@ -122,9 +122,80 @@ public function testGetForms(): void { * Tests GFUtils::get_last_form_page(). */ public function testGetLastFormPage(): void { - $this->markTestIncomplete( - 'This test has not been implemented yet. Requires PageField arguments.' + // These will increment. + $id = 1; + $page_number = 1; + + $form_id = $this->factory->form->create( + array_merge( + [ + 'fields' => [ + $this->factory->field->create( + array_merge( + $this->tester->getPropertyHelper( 'NumberField' )->values, + [ + 'id' => $id++, + 'pageNumber' => $page_number, + 'isRequired' => true, + ] + ) + ), + $this->factory->field->create( + array_merge( + $this->tester->getPropertyHelper( 'PageField' )->values, + [ + 'id' => $id++, + 'pageNumber' => ++$page_number, + 'isRequired' => false, + 'conditionalLogic' => [ + 'actionType' => 'show', + 'logicType' => 'all', + 'rules' => [ + [ + 'fieldId' => 1, + 'operator' => 'is', + 'value' => 2, + ], + ], + ], + ] + ) + ), + $this->factory->field->create( + array_merge( + $this->tester->getPropertyHelper( 'NumberField' )->values, + [ + 'id' => $id++, + 'pageNumber' => $page_number, + 'isRequired' => true, + ] + ) + ), + $this->factory->field->create( + array_merge( + $this->tester->getPropertyHelper( 'PageField' )->values, + [ + 'id' => $id++, + 'pageNumber' => ++$page_number, + ] + ) + ), + ], + ], + $this->tester->getFormDefaultArgs() + ) ); + + $expected = 3; + + $form = $this->factory->form->get_object_by_id( $form_id ); + + $actual = GFUtils::get_last_form_page( $form ); + + $this->assertEquals( $expected, $actual ); + + // Cleanup. + $this->factory->form->delete( $form_id ); } /** diff --git a/tests/wpunit/RadioFieldOtherChoiceTest.php b/tests/wpunit/RadioFieldOtherChoiceTest.php index 7b8342b7..58e20d69 100644 --- a/tests/wpunit/RadioFieldOtherChoiceTest.php +++ b/tests/wpunit/RadioFieldOtherChoiceTest.php @@ -58,14 +58,16 @@ public function field_helper() { * Generates the form fields from factory. Must be wrappend in an array. */ public function generate_fields(): array { - return [ $this->factory->field->create( - array_merge( - $this->property_helper->values, - [ - 'enableOtherChoice' => true, - ] - ) - ) ]; + return [ + $this->factory->field->create( + array_merge( + $this->property_helper->values, + [ + 'enableOtherChoice' => true, + ] + ) + ), + ]; } /** diff --git a/tests/wpunit/SubmitFormMultipageTest.php b/tests/wpunit/SubmitFormMultipageTest.php index 171447fc..c24cda89 100644 --- a/tests/wpunit/SubmitFormMultipageTest.php +++ b/tests/wpunit/SubmitFormMultipageTest.php @@ -22,7 +22,7 @@ public function setUp(): void { wp_set_current_user( $this->admin->ID ); - $this->fields = $this->generate_form_fields(); + $this->fields = $this->generate_form_fields(); $this->form_id = $this->factory->form->create( array_merge( [ 'fields' => $this->fields ], @@ -33,7 +33,6 @@ public function setUp(): void { $this->clearSchema(); } - /** * {@inheritDoc} */ @@ -47,7 +46,7 @@ public function tearDown(): void { private function generate_form_fields(): array { // This will increment as we use them. - $id = 1; + $id = 1; $page_number = 1; return [ @@ -55,7 +54,7 @@ private function generate_form_fields(): array { array_merge( $this->tester->getPropertyHelper( 'NumberField' )->values, [ - 'id' => $id++, + 'id' => $id++, 'pageNumber' => $page_number, 'isRequired' => true, ] @@ -65,20 +64,20 @@ private function generate_form_fields(): array { array_merge( $this->tester->getPropertyHelper( 'PageField' )->values, [ - 'id' => $id++, - 'pageNumber' => ++$page_number, - 'isRequired' => false, + 'id' => $id++, + 'pageNumber' => ++$page_number, + 'isRequired' => false, 'conditionalLogic' => [ 'actionType' => 'show', - 'logicType' => 'all', - 'rules' => [ + 'logicType' => 'all', + 'rules' => [ [ - 'fieldId' => 1, + 'fieldId' => 1, 'operator' => 'is', - 'value' => 2 - ] - ] - ] + 'value' => 2, + ], + ], + ], ] ) ), @@ -86,7 +85,7 @@ private function generate_form_fields(): array { array_merge( $this->tester->getPropertyHelper( 'NumberField' )->values, [ - 'id' => $id++, + 'id' => $id++, 'pageNumber' => $page_number, 'isRequired' => true, ] @@ -105,13 +104,13 @@ private function generate_form_fields(): array { array_merge( $this->tester->getPropertyHelper( 'NumberField' )->values, [ - 'id' => $id++, - 'pageNumber' => $page_number, - 'isRequired' => true, + 'id' => $id++, + 'pageNumber' => $page_number, + 'isRequired' => true, 'defaultValue' => 'default value', ] ) - ) + ), ]; } @@ -158,12 +157,12 @@ public function testSubmit(): void { 'input' => [ 'id' => $this->form_id, 'saveAsDraft' => false, - ] + ], ]; // Submit the first page with invalid value. - $variables['input']['sourcePage'] = 1; - $variables['input']['targetPage'] = 2; + $variables['input']['sourcePage'] = 1; + $variables['input']['targetPage'] = 2; $variables['input']['fieldValues'] = []; $actual = $this->graphql( compact( 'query', 'variables' ) ); @@ -173,12 +172,12 @@ public function testSubmit(): void { $this->assertNotEmpty( $actual['data']['submitGfForm']['errors'] ); $this->assertEquals( 1, $actual['data']['submitGfForm']['targetPageNumber'], 'The target page number should be the invalid page' ); - $this->clear_form_field_state(); + $this->clear_form_field_state(); // On a value that isnt 2, the 3rd page should be the target page. $variables['input']['fieldValues'] = [ [ - 'id' => 1, + 'id' => 1, 'value' => '0', ], ]; @@ -200,7 +199,7 @@ public function testSubmit(): void { $variables['input']['fieldValues'] = [ [ - 'id' => 1, + 'id' => 1, 'value' => '2', ], ]; @@ -244,7 +243,7 @@ public function testSubmit(): void { $variables['input']['fieldValues'], [ [ - 'id' => 3, + 'id' => 3, 'value' => '2', ], ] @@ -284,7 +283,7 @@ public function testSubmit(): void { $variables['input']['fieldValues'], [ [ - 'id' => 5, + 'id' => 5, 'value' => '1', ], ] @@ -298,14 +297,13 @@ public function testSubmit(): void { $this->assertNull( $actual['data']['submitGfForm']['targetPageNumber'] ); $this->assertEmpty( $actual['data']['submitGfForm']['targetPageFormFields'] ); - // Test as Draft. $this->clear_form_field_state(); $variables['input']['saveAsDraft'] = true; $variables['input']['fieldValues'] = []; - $variables['input']['sourcePage'] = 1; - $variables['input']['targetPage'] = 3; + $variables['input']['sourcePage'] = 1; + $variables['input']['targetPage'] = 3; $actual = $this->graphql( compact( 'query', 'variables' ) ); @@ -324,7 +322,7 @@ public function testSubmit(): void { private function clear_form_field_state(): void { $form = GFAPI::get_form( $this->form_id ); - foreach( $form['fields'] as $field ) { + foreach ( $form['fields'] as $field ) { unset( $field->failed_validation ); unset( $field->validation_message ); } diff --git a/vendor/composer/installed.php b/vendor/composer/installed.php index cb656a99..4b2049e8 100644 --- a/vendor/composer/installed.php +++ b/vendor/composer/installed.php @@ -3,7 +3,7 @@ 'name' => 'harness-software/wp-graphql-gravity-forms', 'pretty_version' => 'dev-develop', 'version' => 'dev-develop', - 'reference' => 'e68b7c0b1d9aaf702384eae00af7d3c94e6c0f29', + 'reference' => 'd5b1ea8aba7e845b05970af4f6bbbf9c0c4683b3', 'type' => 'wordpress-plugin', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), @@ -13,7 +13,7 @@ 'harness-software/wp-graphql-gravity-forms' => array( 'pretty_version' => 'dev-develop', 'version' => 'dev-develop', - 'reference' => 'e68b7c0b1d9aaf702384eae00af7d3c94e6c0f29', + 'reference' => 'd5b1ea8aba7e845b05970af4f6bbbf9c0c4683b3', 'type' => 'wordpress-plugin', 'install_path' => __DIR__ . '/../../', 'aliases' => array(),