diff --git a/app/code/Magento/CustomerGraphQl/etc/schema.graphqls b/app/code/Magento/CustomerGraphQl/etc/schema.graphqls index 86ab39bbee25c..9aa1fdaa841e4 100644 --- a/app/code/Magento/CustomerGraphQl/etc/schema.graphqls +++ b/app/code/Magento/CustomerGraphQl/etc/schema.graphqls @@ -61,7 +61,7 @@ input CustomerInput { middlename: String @doc(description: "The customer's middle name") lastname: String @doc(description: "The customer's family name") suffix: String @doc(description: "A value such as Sr., Jr., or III") - email: String! @doc(description: "The customer's email address. Required") + email: String @doc(description: "The customer's email address. Required for customer creation") dob: String @doc(description: "Deprecated: Use `date_of_birth` instead") date_of_birth: String @doc(description: "The customer's date of birth") taxvat: String @doc(description: "The customer's Tax/VAT number (for corporate customers)") diff --git a/composer.lock b/composer.lock index 8bcfbb73d0a3d..f5e4fe783879e 100644 --- a/composer.lock +++ b/composer.lock @@ -1,7 +1,7 @@ { "_readme": [ "This file locks the dependencies of your project to a known state", - "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], "content-hash": "21394914b3f105a33f583ba59aeba748", @@ -73,6 +73,7 @@ "File.php" ] }, + "notification-url": "https://packagist.org/downloads/", "license": [ "BSD-3-Clause" ], @@ -83,10 +84,6 @@ ], "description": "The stock Zend_Cache_Backend_File backend has extremely poor performance for cleaning by tags making it become unusable as the number of cached items increases. This backend makes many changes resulting in a huge performance boost, especially for tag cleaning.", "homepage": "https://github.com/colinmollenhour/Cm_Cache_Backend_File", - "support": { - "source": "https://github.com/colinmollenhour/Cm_Cache_Backend_File/tree/v1.4.5", - "issues": "https://github.com/colinmollenhour/Cm_Cache_Backend_File/issues" - }, "time": "2019-04-18T21:54:31+00:00" }, { @@ -112,6 +109,7 @@ "Cm/Cache/Backend/Redis.php" ] }, + "notification-url": "https://packagist.org/downloads/", "license": [ "BSD-3-Clause" ], @@ -122,10 +120,6 @@ ], "description": "Zend_Cache backend using Redis with full support for tags.", "homepage": "https://github.com/colinmollenhour/Cm_Cache_Backend_Redis", - "support": { - "source": "https://github.com/colinmollenhour/Cm_Cache_Backend_Redis/tree/1.10.6", - "issues": "https://github.com/colinmollenhour/Cm_Cache_Backend_Redis/issues" - }, "time": "2018-09-24T16:02:07+00:00" }, { @@ -465,24 +459,24 @@ }, { "name": "composer/xdebug-handler", - "version": "1.3.3", + "version": "1.4.0", "source": { "type": "git", "url": "https://github.com/composer/xdebug-handler.git", - "reference": "46867cbf8ca9fb8d60c506895449eb799db1184f" + "reference": "cbe23383749496fe0f373345208b79568e4bc248" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/46867cbf8ca9fb8d60c506895449eb799db1184f", - "reference": "46867cbf8ca9fb8d60c506895449eb799db1184f", + "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/cbe23383749496fe0f373345208b79568e4bc248", + "reference": "cbe23383749496fe0f373345208b79568e4bc248", "shasum": "" }, "require": { - "php": "^5.3.2 || ^7.0", + "php": "^5.3.2 || ^7.0 || ^8.0", "psr/log": "^1.0" }, "require-dev": { - "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.5" + "phpunit/phpunit": "^4.8.35 || ^5.7 || 6.5 - 8" }, "type": "library", "autoload": { @@ -500,12 +494,12 @@ "email": "john-stevenson@blueyonder.co.uk" } ], - "description": "Restarts a process without xdebug.", + "description": "Restarts a process without Xdebug.", "keywords": [ "Xdebug", "performance" ], - "time": "2019-05-27T17:52:04+00:00" + "time": "2019-11-06T16:40:04+00:00" }, { "name": "container-interop/container-interop", @@ -1003,12 +997,6 @@ "reference": "8b6c32f53b4944a5d6656e86344cd0f9784709a1", "shasum": "" }, - "archive": { - "exclude": [ - "vendor", - "/tests/FullStackTest/" - ] - }, "require": { "composer-plugin-api": "^1.0" }, @@ -1036,10 +1024,15 @@ "MagentoHackathon\\Composer\\Magento": "src/" } }, + "notification-url": "https://packagist.org/downloads/", "license": [ "OSL-3.0" ], "authors": [ + { + "name": "Vinai Kopp", + "email": "vinai@netzarbeiter.com" + }, { "name": "Daniel Fahlke aka Flyingmana", "email": "flyingmana@googlemail.com" @@ -1059,10 +1052,6 @@ { "name": "David Fuhr", "email": "fuhr@flagbit.de" - }, - { - "name": "Vinai Kopp", - "email": "vinai@netzarbeiter.com" } ], "description": "Composer installer for Magento modules", @@ -1071,9 +1060,6 @@ "composer-installer", "magento" ], - "support": { - "source": "https://github.com/magento/magento-composer-installer/tree/0.1.13" - }, "time": "2017-12-29T16:45:24+00:00" }, { @@ -1248,16 +1234,16 @@ }, { "name": "paragonie/sodium_compat", - "version": "v1.12.0", + "version": "v1.12.1", "source": { "type": "git", "url": "https://github.com/paragonie/sodium_compat.git", - "reference": "8228b286d6b8fe24825f42ce02403f72656ac826" + "reference": "063cae9b3a7323579063e7037720f5b52b56c178" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/paragonie/sodium_compat/zipball/8228b286d6b8fe24825f42ce02403f72656ac826", - "reference": "8228b286d6b8fe24825f42ce02403f72656ac826", + "url": "https://api.github.com/repos/paragonie/sodium_compat/zipball/063cae9b3a7323579063e7037720f5b52b56c178", + "reference": "063cae9b3a7323579063e7037720f5b52b56c178", "shasum": "" }, "require": { @@ -1326,7 +1312,7 @@ "secret-key cryptography", "side-channel resistant" ], - "time": "2019-10-19T15:30:42+00:00" + "time": "2019-11-07T17:07:24+00:00" }, { "name": "pelago/emogrifier", @@ -1404,36 +1390,39 @@ }, { "name": "php-amqplib/php-amqplib", - "version": "v2.10.1", + "version": "v2.7.3", "source": { "type": "git", "url": "https://github.com/php-amqplib/php-amqplib.git", - "reference": "6e2b2501e021e994fb64429e5a78118f83b5c200" + "reference": "a8ba54bd35b973fc6861e4c2e105f71e9e95f43f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-amqplib/php-amqplib/zipball/6e2b2501e021e994fb64429e5a78118f83b5c200", - "reference": "6e2b2501e021e994fb64429e5a78118f83b5c200", + "url": "https://api.github.com/repos/php-amqplib/php-amqplib/zipball/a8ba54bd35b973fc6861e4c2e105f71e9e95f43f", + "reference": "a8ba54bd35b973fc6861e4c2e105f71e9e95f43f", "shasum": "" }, "require": { "ext-bcmath": "*", - "ext-sockets": "*", - "php": ">=5.6" + "ext-mbstring": "*", + "php": ">=5.3.0" }, "replace": { "videlalvaro/php-amqplib": "self.version" }, "require-dev": { - "ext-curl": "*", - "nategood/httpful": "^0.2.20", - "phpunit/phpunit": "^5.7|^6.5|^7.0", + "phpdocumentor/phpdocumentor": "^2.9", + "phpunit/phpunit": "^4.8", + "scrutinizer/ocular": "^1.1", "squizlabs/php_codesniffer": "^2.5" }, + "suggest": { + "ext-sockets": "Use AMQPSocketConnection" + }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.10-dev" + "dev-master": "2.7-dev" } }, "autoload": { @@ -1459,11 +1448,6 @@ "name": "Raúl Araya", "email": "nubeiro@gmail.com", "role": "Maintainer" - }, - { - "name": "Luke Bakken", - "email": "luke@bakken.io", - "role": "Maintainer" } ], "description": "Formerly videlalvaro/php-amqplib. This library is a pure PHP implementation of the AMQP protocol. It's been tested against RabbitMQ.", @@ -1473,7 +1457,7 @@ "queue", "rabbitmq" ], - "time": "2019-10-10T13:23:40+00:00" + "time": "2018-04-30T03:54:54+00:00" }, { "name": "phpseclib/mcrypt_compat", @@ -2096,7 +2080,7 @@ }, { "name": "symfony/css-selector", - "version": "v4.3.6", + "version": "v4.3.7", "source": { "type": "git", "url": "https://github.com/symfony/css-selector.git", @@ -2149,16 +2133,16 @@ }, { "name": "symfony/event-dispatcher", - "version": "v4.3.6", + "version": "v4.3.7", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "6229f58993e5a157f6096fc7145c0717d0be8807" + "reference": "0df002fd4f500392eabd243c2947061a50937287" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/6229f58993e5a157f6096fc7145c0717d0be8807", - "reference": "6229f58993e5a157f6096fc7145c0717d0be8807", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/0df002fd4f500392eabd243c2947061a50937287", + "reference": "0df002fd4f500392eabd243c2947061a50937287", "shasum": "" }, "require": { @@ -2215,7 +2199,7 @@ ], "description": "Symfony EventDispatcher Component", "homepage": "https://symfony.com", - "time": "2019-10-01T16:40:32+00:00" + "time": "2019-11-03T09:04:05+00:00" }, { "name": "symfony/event-dispatcher-contracts", @@ -2277,7 +2261,7 @@ }, { "name": "symfony/filesystem", - "version": "v4.3.6", + "version": "v4.3.7", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", @@ -2327,7 +2311,7 @@ }, { "name": "symfony/finder", - "version": "v4.3.6", + "version": "v4.3.7", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", @@ -2493,7 +2477,7 @@ }, { "name": "symfony/process", - "version": "v4.3.6", + "version": "v4.3.7", "source": { "type": "git", "url": "https://github.com/symfony/process.git", @@ -6175,16 +6159,16 @@ }, { "name": "doctrine/cache", - "version": "v1.8.1", + "version": "1.9.0", "source": { "type": "git", "url": "https://github.com/doctrine/cache.git", - "reference": "d4374ae95b36062d02ef310100ed33d78738d76c" + "reference": "c15dcd24b756f9e52ea7c3ae8227354f3628f11a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/cache/zipball/d4374ae95b36062d02ef310100ed33d78738d76c", - "reference": "d4374ae95b36062d02ef310100ed33d78738d76c", + "url": "https://api.github.com/repos/doctrine/cache/zipball/c15dcd24b756f9e52ea7c3ae8227354f3628f11a", + "reference": "c15dcd24b756f9e52ea7c3ae8227354f3628f11a", "shasum": "" }, "require": { @@ -6195,7 +6179,7 @@ }, "require-dev": { "alcaeus/mongo-php-adapter": "^1.1", - "doctrine/coding-standard": "^4.0", + "doctrine/coding-standard": "^6.0", "mongodb/mongodb": "^1.1", "phpunit/phpunit": "^7.0", "predis/predis": "~1.0" @@ -6206,7 +6190,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.8.x-dev" + "dev-master": "1.9.x-dev" } }, "autoload": { @@ -6240,13 +6224,21 @@ "email": "schmittjoh@gmail.com" } ], - "description": "Caching library offering an object-oriented API for many cache backends", - "homepage": "https://www.doctrine-project.org", + "description": "PHP Doctrine Cache library is a popular cache implementation that supports many different drivers such as redis, memcache, apc, mongodb and others.", + "homepage": "https://www.doctrine-project.org/projects/cache.html", "keywords": [ + "abstraction", + "apcu", "cache", - "caching" + "caching", + "couchdb", + "memcached", + "php", + "redis", + "riak", + "xcache" ], - "time": "2019-10-28T09:31:32+00:00" + "time": "2019-11-11T10:31:52+00:00" }, { "name": "doctrine/inflector", @@ -6317,16 +6309,16 @@ }, { "name": "doctrine/instantiator", - "version": "1.2.0", + "version": "1.3.0", "source": { "type": "git", "url": "https://github.com/doctrine/instantiator.git", - "reference": "a2c590166b2133a4633738648b6b064edae0814a" + "reference": "ae466f726242e637cebdd526a7d991b9433bacf1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/instantiator/zipball/a2c590166b2133a4633738648b6b064edae0814a", - "reference": "a2c590166b2133a4633738648b6b064edae0814a", + "url": "https://api.github.com/repos/doctrine/instantiator/zipball/ae466f726242e637cebdd526a7d991b9433bacf1", + "reference": "ae466f726242e637cebdd526a7d991b9433bacf1", "shasum": "" }, "require": { @@ -6369,34 +6361,32 @@ "constructor", "instantiate" ], - "time": "2019-03-17T17:37:11+00:00" + "time": "2019-10-21T16:45:58+00:00" }, { "name": "doctrine/lexer", - "version": "1.1.0", + "version": "1.0.2", "source": { "type": "git", "url": "https://github.com/doctrine/lexer.git", - "reference": "e17f069ede36f7534b95adec71910ed1b49c74ea" + "reference": "1febd6c3ef84253d7c815bed85fc622ad207a9f8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/lexer/zipball/e17f069ede36f7534b95adec71910ed1b49c74ea", - "reference": "e17f069ede36f7534b95adec71910ed1b49c74ea", + "url": "https://api.github.com/repos/doctrine/lexer/zipball/1febd6c3ef84253d7c815bed85fc622ad207a9f8", + "reference": "1febd6c3ef84253d7c815bed85fc622ad207a9f8", "shasum": "" }, "require": { - "php": "^7.2" + "php": ">=5.3.2" }, "require-dev": { - "doctrine/coding-standard": "^6.0", - "phpstan/phpstan": "^0.11.8", - "phpunit/phpunit": "^8.2" + "phpunit/phpunit": "^4.5" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.1.x-dev" + "dev-master": "1.0.x-dev" } }, "autoload": { @@ -6409,14 +6399,14 @@ "MIT" ], "authors": [ - { - "name": "Guilherme Blanco", - "email": "guilhermeblanco@gmail.com" - }, { "name": "Roman Borschel", "email": "roman@code-factory.org" }, + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, { "name": "Johannes Schmitt", "email": "schmittjoh@gmail.com" @@ -6431,7 +6421,7 @@ "parser", "php" ], - "time": "2019-07-30T19:33:28+00:00" + "time": "2019-06-08T11:03:04+00:00" }, { "name": "facebook/webdriver", @@ -7677,16 +7667,16 @@ }, { "name": "phpcompatibility/php-compatibility", - "version": "9.3.2", + "version": "9.3.3", "source": { "type": "git", "url": "https://github.com/PHPCompatibility/PHPCompatibility.git", - "reference": "bfca2be3992f40e92206e5a7ebe5eaee37280b58" + "reference": "1af08ca3861048a8bfb39d0405d0ac3e50ba2696" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibility/zipball/bfca2be3992f40e92206e5a7ebe5eaee37280b58", - "reference": "bfca2be3992f40e92206e5a7ebe5eaee37280b58", + "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibility/zipball/1af08ca3861048a8bfb39d0405d0ac3e50ba2696", + "reference": "1af08ca3861048a8bfb39d0405d0ac3e50ba2696", "shasum": "" }, "require": { @@ -7731,7 +7721,7 @@ "phpcs", "standards" ], - "time": "2019-10-16T21:24:24+00:00" + "time": "2019-11-11T03:25:23+00:00" }, { "name": "phpdocumentor/reflection-common", @@ -7953,28 +7943,28 @@ }, { "name": "phpoption/phpoption", - "version": "1.5.0", + "version": "1.5.2", "source": { "type": "git", "url": "https://github.com/schmittjoh/php-option.git", - "reference": "94e644f7d2051a5f0fcf77d81605f152eecff0ed" + "reference": "2ba2586380f8d2b44ad1b9feb61c371020b27793" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/schmittjoh/php-option/zipball/94e644f7d2051a5f0fcf77d81605f152eecff0ed", - "reference": "94e644f7d2051a5f0fcf77d81605f152eecff0ed", + "url": "https://api.github.com/repos/schmittjoh/php-option/zipball/2ba2586380f8d2b44ad1b9feb61c371020b27793", + "reference": "2ba2586380f8d2b44ad1b9feb61c371020b27793", "shasum": "" }, "require": { "php": ">=5.3.0" }, "require-dev": { - "phpunit/phpunit": "4.7.*" + "phpunit/phpunit": "^4.7|^5.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.3-dev" + "dev-master": "1.5-dev" } }, "autoload": { @@ -7984,7 +7974,7 @@ }, "notification-url": "https://packagist.org/downloads/", "license": [ - "Apache2" + "Apache-2.0" ], "authors": [ { @@ -7999,7 +7989,7 @@ "php", "type" ], - "time": "2015-07-25T16:39:46+00:00" + "time": "2019-11-06T22:27:00+00:00" }, { "name": "phpspec/prophecy", @@ -9252,7 +9242,7 @@ }, { "name": "symfony/browser-kit", - "version": "v4.3.6", + "version": "v4.3.7", "source": { "type": "git", "url": "https://github.com/symfony/browser-kit.git", @@ -9311,16 +9301,16 @@ }, { "name": "symfony/config", - "version": "v4.3.6", + "version": "v4.3.7", "source": { "type": "git", "url": "https://github.com/symfony/config.git", - "reference": "f4ee0ebb91b16ca1ac105aa39f9284f3cac19a15" + "reference": "8267214841c44d315a55242ea867684eb43c42ce" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/config/zipball/f4ee0ebb91b16ca1ac105aa39f9284f3cac19a15", - "reference": "f4ee0ebb91b16ca1ac105aa39f9284f3cac19a15", + "url": "https://api.github.com/repos/symfony/config/zipball/8267214841c44d315a55242ea867684eb43c42ce", + "reference": "8267214841c44d315a55242ea867684eb43c42ce", "shasum": "" }, "require": { @@ -9371,20 +9361,20 @@ ], "description": "Symfony Config Component", "homepage": "https://symfony.com", - "time": "2019-10-30T13:18:51+00:00" + "time": "2019-11-08T08:31:27+00:00" }, { "name": "symfony/dependency-injection", - "version": "v4.3.6", + "version": "v4.3.7", "source": { "type": "git", "url": "https://github.com/symfony/dependency-injection.git", - "reference": "fc036941dfafa037a7485714b62593c7eaf68edd" + "reference": "80c6d9e19467dfbba14f830ed478eb592ce51b64" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/fc036941dfafa037a7485714b62593c7eaf68edd", - "reference": "fc036941dfafa037a7485714b62593c7eaf68edd", + "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/80c6d9e19467dfbba14f830ed478eb592ce51b64", + "reference": "80c6d9e19467dfbba14f830ed478eb592ce51b64", "shasum": "" }, "require": { @@ -9444,11 +9434,11 @@ ], "description": "Symfony DependencyInjection Component", "homepage": "https://symfony.com", - "time": "2019-10-28T17:07:32+00:00" + "time": "2019-11-08T16:22:27+00:00" }, { "name": "symfony/dom-crawler", - "version": "v4.3.6", + "version": "v4.3.7", "source": { "type": "git", "url": "https://github.com/symfony/dom-crawler.git", @@ -9564,7 +9554,7 @@ }, { "name": "symfony/options-resolver", - "version": "v4.3.6", + "version": "v4.3.7", "source": { "type": "git", "url": "https://github.com/symfony/options-resolver.git", @@ -9846,16 +9836,16 @@ }, { "name": "symfony/service-contracts", - "version": "v1.1.7", + "version": "v1.1.8", "source": { "type": "git", "url": "https://github.com/symfony/service-contracts.git", - "reference": "ffcde9615dc5bb4825b9f6aed07716f1f57faae0" + "reference": "ffc7f5692092df31515df2a5ecf3b7302b3ddacf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/service-contracts/zipball/ffcde9615dc5bb4825b9f6aed07716f1f57faae0", - "reference": "ffcde9615dc5bb4825b9f6aed07716f1f57faae0", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/ffc7f5692092df31515df2a5ecf3b7302b3ddacf", + "reference": "ffc7f5692092df31515df2a5ecf3b7302b3ddacf", "shasum": "" }, "require": { @@ -9900,20 +9890,20 @@ "interoperability", "standards" ], - "time": "2019-09-17T11:12:18+00:00" + "time": "2019-10-14T12:27:06+00:00" }, { "name": "symfony/stopwatch", - "version": "v4.3.6", + "version": "v4.3.7", "source": { "type": "git", "url": "https://github.com/symfony/stopwatch.git", - "reference": "1e4ff456bd625be5032fac9be4294e60442e9b71" + "reference": "e96c259de6abcd0cead71f0bf4d730d53ee464d0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/stopwatch/zipball/1e4ff456bd625be5032fac9be4294e60442e9b71", - "reference": "1e4ff456bd625be5032fac9be4294e60442e9b71", + "url": "https://api.github.com/repos/symfony/stopwatch/zipball/e96c259de6abcd0cead71f0bf4d730d53ee464d0", + "reference": "e96c259de6abcd0cead71f0bf4d730d53ee464d0", "shasum": "" }, "require": { @@ -9950,11 +9940,11 @@ ], "description": "Symfony Stopwatch Component", "homepage": "https://symfony.com", - "time": "2019-08-07T11:52:19+00:00" + "time": "2019-11-05T14:48:09+00:00" }, { "name": "symfony/yaml", - "version": "v4.3.6", + "version": "v4.3.7", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/AuthorizenetAcceptjs/Customer/SetPaymentMethodTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/AuthorizenetAcceptjs/Customer/SetPaymentMethodTest.php index 0ca1be775258d..e9ab4456fae81 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/AuthorizenetAcceptjs/Customer/SetPaymentMethodTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/AuthorizenetAcceptjs/Customer/SetPaymentMethodTest.php @@ -126,17 +126,19 @@ public function dataProviderTestPlaceOrder(): array * @magentoApiDataFixture Magento/GraphQl/Quote/_files/set_flatrate_shipping_method.php * @dataProvider dataProviderSetPaymentInvalidInput * @param \Closure $getMutationClosure - * @param string $expectedMessage + * @param array $expectedMessages * @expectedException \Exception */ - public function testSetPaymentInvalidInput(\Closure $getMutationClosure, string $expectedMessage) + public function testSetPaymentInvalidInput(\Closure $getMutationClosure, array $expectedMessages) { $reservedOrderId = 'test_quote'; $maskedQuoteId = $this->getMaskedQuoteIdByReservedOrderId->execute($reservedOrderId); $setPaymentMutation = $getMutationClosure($maskedQuoteId); - $this->expectExceptionMessage($expectedMessage); + foreach ($expectedMessages as $expectedMessage) { + $this->expectExceptionMessage($expectedMessage); + } $this->graphQlMutation($setPaymentMutation, [], '', $this->getHeaderMap()); } @@ -152,13 +154,20 @@ public function dataProviderSetPaymentInvalidInput(): array function (string $maskedQuoteId) { return $this->getInvalidSetPaymentMutation($maskedQuoteId); }, - 'Required parameter "authorizenet_acceptjs" for "payment_method" is missing.', + [ + 'Required parameter "authorizenet_acceptjs" for "payment_method" is missing.' + ] ], [ function (string $maskedQuoteId) { return $this->getEmptyAcceptJsInput($maskedQuoteId); }, - 'for "authorizenet_acceptjs" is missing.', + [ + 'Field AuthorizenetInput.cc_last_4 of required type Int! was not provided.', + 'Field AuthorizenetInput.opaque_data_descriptor of required type String! was not provided.', + 'Field AuthorizenetInput.opaque_data_value of required type String! was not provided.' + ] + ], [ function (string $maskedQuoteId) { @@ -168,13 +177,17 @@ function (string $maskedQuoteId) { static::VALID_NONCE ); }, - 'parameter "cc_last_4" for "authorizenet_acceptjs" is missing', + [ + 'Field AuthorizenetInput.cc_last_4 of required type Int! was not provided', + ] ], [ function (string $maskedQuoteId) { return $this->getMissingOpaqueDataValueAcceptJsInput($maskedQuoteId, static::VALID_DESCRIPTOR); }, - 'parameter "opaque_data_value" for "authorizenet_acceptjs" is missing', + [ + 'Field AuthorizenetInput.opaque_data_value of required type String! was not provided', + ] ], ]; } diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Braintree/Customer/SetPaymentMethodTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Braintree/Customer/SetPaymentMethodTest.php index ad756dfdd2e44..a282b295c2974 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Braintree/Customer/SetPaymentMethodTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Braintree/Customer/SetPaymentMethodTest.php @@ -259,6 +259,14 @@ public function testSetPaymentMethodInvalidMethodInput(string $methodCode) $methodCode ); $this->expectExceptionMessage("for \"$methodCode\" is missing."); + $expectedExceptionMessages = [ + 'braintree' => + 'Field BraintreeInput.is_active_payment_token_enabler of required type Boolean! was not provided.', + 'braintree_cc_vault' => + 'Field BraintreeCcVaultInput.public_hash of required type String! was not provided.' + ]; + + $this->expectExceptionMessage($expectedExceptionMessages[$methodCode]); $this->graphQlMutation($setPaymentQuery, [], '', $this->getHeaderMap()); } @@ -277,7 +285,6 @@ public function testSetPaymentMethodInvalidMethodInput(string $methodCode) * @magentoApiDataFixture Magento/GraphQl/Quote/_files/set_new_shipping_address.php * @magentoApiDataFixture Magento/GraphQl/Quote/_files/set_new_billing_address.php * @magentoApiDataFixture Magento/GraphQl/Quote/_files/set_flatrate_shipping_method.php - * @dataProvider dataProviderTestSetPaymentMethodInvalidInput * @expectedException \Exception */ public function testSetPaymentMethodWithoutRequiredPaymentMethodInput() @@ -286,7 +293,9 @@ public function testSetPaymentMethodWithoutRequiredPaymentMethodInput() $maskedQuoteId = $this->getMaskedQuoteIdByReservedOrderId->execute($reservedOrderId); $setPaymentQuery = $this->getSetPaymentBraintreeQueryInvalidPaymentMethodInput($maskedQuoteId); - $this->expectExceptionMessage("for \"braintree\" is missing."); + $this->expectExceptionMessage( + 'Field BraintreeInput.is_active_payment_token_enabler of required type Boolean! was not provided.' + ); $this->graphQlMutation($setPaymentQuery, [], '', $this->getHeaderMap()); } diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Braintree/Guest/SetPaymentMethodTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Braintree/Guest/SetPaymentMethodTest.php index 5ee7dd457657c..c0a7491cbc1bf 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Braintree/Guest/SetPaymentMethodTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Braintree/Guest/SetPaymentMethodTest.php @@ -151,7 +151,14 @@ public function testSetPaymentMethodInvalidMethodInput() $maskedQuoteId = $this->getMaskedQuoteIdByReservedOrderId->execute($reservedOrderId); $setPaymentQuery = $this->getSetPaymentBraintreeQueryInvalidMethodInput($maskedQuoteId); - $this->expectExceptionMessage("for \"braintree\" is missing."); + + $this->expectExceptionMessage( + 'Field BraintreeInput.is_active_payment_token_enabler of required type Boolean! was not provided' + ); + $this->expectExceptionMessage( + 'Field BraintreeInput.payment_method_nonce of required type String! was not provided.' + ); + $this->graphQlMutation($setPaymentQuery); } diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Customer/CreateCustomerTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Customer/CreateCustomerTest.php index 0be968d6d340d..618fe289ad566 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Customer/CreateCustomerTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Customer/CreateCustomerTest.php @@ -114,7 +114,7 @@ public function testCreateCustomerAccountWithoutPassword() /** * @expectedException \Exception - * @expectedExceptionMessage Field CustomerInput.email of required type String! was not provided + * @expectedExceptionMessage "input" value should be specified */ public function testCreateCustomerIfInputDataIsEmpty() { @@ -140,7 +140,7 @@ public function testCreateCustomerIfInputDataIsEmpty() /** * @expectedException \Exception - * @expectedExceptionMessage Field CustomerInput.email of required type String! was not provided + * @expectedExceptionMessage Required parameters are missing: Email */ public function testCreateCustomerIfEmailMissed() { diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Framework/RequiredInputArgumentTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Framework/RequiredInputArgumentTest.php new file mode 100644 index 0000000000000..9fecc954d1182 --- /dev/null +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Framework/RequiredInputArgumentTest.php @@ -0,0 +1,77 @@ +expectException(ResponseContainsErrorsException::class); + $this->expectExceptionMessage($expectedExceptionsMessage); + + $this->graphQlQuery($query); + } + + /** + * Test that a more complex required argument is handled properly + * + * updateCartItems mutation has required parameter input.cart_items.cart_item_id + */ + public function testInputObjectArgumentRequired() + { + $query = <<expectException(ResponseContainsErrorsException::class); + $this->expectExceptionMessage($expectedExceptionsMessage); + + $this->graphQlMutation($query); + } +} diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/AddSimpleProductToCartTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/AddSimpleProductToCartTest.php index f7ba5b4d924fb..cd9b48bccaf22 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/AddSimpleProductToCartTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/AddSimpleProductToCartTest.php @@ -85,7 +85,7 @@ public function testAddSimpleProductToCart() /** * @magentoApiDataFixture Magento/Customer/_files/customer.php * @expectedException Exception - * @expectedExceptionMessage Required parameter "cart_id" is missing + * @expectedExceptionMessage Field AddSimpleProductsToCartInput.cart_id of required type String! was not provided. */ public function testAddSimpleProductToCartIfCartIdIsMissed() { @@ -138,7 +138,6 @@ public function testAddSimpleProductToCartIfCartIdIsEmpty() /** * @magentoApiDataFixture Magento/Customer/_files/customer.php * @expectedException Exception - * @expectedExceptionMessage Required parameter "cart_items" is missing */ public function testAddSimpleProductToCartIfCartItemsAreMissed() { @@ -158,6 +157,11 @@ public function testAddSimpleProductToCartIfCartItemsAreMissed() } QUERY; + $this->expectExceptionMessage( + 'Field AddSimpleProductsToCartInput.cart_items of required type' + . ' [SimpleProductCartItemInput]! was not provided.' + ); + $this->graphQlMutation($query, [], '', $this->getHeaderMap()); } diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/AddVirtualProductToCartTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/AddVirtualProductToCartTest.php index ae0208ca3101b..a7a3028f2a369 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/AddVirtualProductToCartTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/AddVirtualProductToCartTest.php @@ -57,7 +57,7 @@ public function testAddVirtualProductToCart() /** * @magentoApiDataFixture Magento/Customer/_files/customer.php * @expectedException Exception - * @expectedExceptionMessage Required parameter "cart_id" is missing + * @expectedExceptionMessage Field AddSimpleProductsToCartInput.cart_id of required type String! was not provided. */ public function testAddVirtualProductToCartIfCartIdIsMissed() { @@ -109,8 +109,6 @@ public function testAddVirtualProductToCartIfCartIdIsEmpty() /** * @magentoApiDataFixture Magento/Customer/_files/customer.php - * @expectedException Exception - * @expectedExceptionMessage Required parameter "cart_items" is missing */ public function testAddVirtualProductToCartIfCartItemsAreMissed() { @@ -129,6 +127,11 @@ public function testAddVirtualProductToCartIfCartItemsAreMissed() } } QUERY; + $this->expectException(\Exception::class); + $this->expectExceptionMessage( + 'Field AddSimpleProductsToCartInput.cart_items of required type [SimpleProductCartItemInput]!' + . ' was not provided.' + ); $this->graphQlMutation($query, [], '', $this->getHeaderMap()); } diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/ApplyCouponToCartTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/ApplyCouponToCartTest.php index df138f9014706..fa96443eaee1e 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/ApplyCouponToCartTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/ApplyCouponToCartTest.php @@ -217,11 +217,11 @@ public function dataProviderUpdateWithMissedRequiredParameters(): array return [ 'missed_cart_id' => [ 'coupon_code: "test"', - 'Required parameter "cart_id" is missing' + 'Field ApplyCouponToCartInput.cart_id of required type String! was not provided.' ], 'missed_coupon_code' => [ 'cart_id: "test_quote"', - 'Required parameter "coupon_code" is missing' + 'Field ApplyCouponToCartInput.coupon_code of required type String! was not provided.' ], ]; } diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/PlaceOrderTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/PlaceOrderTest.php index 38d9ddc4fecc1..189d5ceab838d 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/PlaceOrderTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/PlaceOrderTest.php @@ -106,7 +106,7 @@ public function testPlaceOrderIfCartIdIsEmpty() /** * @magentoApiDataFixture Magento/Customer/_files/customer.php * @expectedException Exception - * @expectedExceptionMessage Required parameter "cart_id" is missing + * @expectedExceptionMessage Field PlaceOrderInput.cart_id of required type String! was not provided. */ public function testPlaceOrderIfCartIdIsMissed() { diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/RemoveCouponFromCartTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/RemoveCouponFromCartTest.php index f906b33fe19d1..d4390e902a3f9 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/RemoveCouponFromCartTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/RemoveCouponFromCartTest.php @@ -73,7 +73,7 @@ public function testRemoveCouponFromCartIfCartIdIsEmpty() /** * @magentoApiDataFixture Magento/Customer/_files/customer.php * @expectedException Exception - * @expectedExceptionMessage Required parameter "cart_id" is missing + * @expectedExceptionMessage Field RemoveCouponFromCartInput.cart_id of required type String! was not provided. */ public function testRemoveCouponFromCartIfCartIdIsMissed() { diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/RemoveItemFromCartTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/RemoveItemFromCartTest.php index b810022403b65..a14aacc974af6 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/RemoveItemFromCartTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/RemoveItemFromCartTest.php @@ -125,11 +125,11 @@ public function dataProviderUpdateWithMissedRequiredParameters(): array return [ 'missed_cart_id' => [ 'cart_item_id: 1', - 'Required parameter "cart_id" is missing.' + 'Field RemoveItemFromCartInput.cart_id of required type String! was not provided.' ], 'missed_cart_item_id' => [ 'cart_id: "test_quote"', - 'Required parameter "cart_item_id" is missing.' + 'Field RemoveItemFromCartInput.cart_item_id of required type Int! was not provided.' ], ]; } diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/SetBillingAddressOnCartTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/SetBillingAddressOnCartTest.php index 40131e2d76575..19a10d9466a32 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/SetBillingAddressOnCartTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/SetBillingAddressOnCartTest.php @@ -660,7 +660,7 @@ public function dataProviderSetWithoutRequiredParameters(): array ], 'missed_cart_id' => [ 'billing_address: {}', - 'Required parameter "cart_id" is missing' + 'Field SetBillingAddressOnCartInput.cart_id of required type String! was not provided.' ], 'missed_region' => [ 'cart_id: "cart_id_value" diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/SetPaymentMethodAndPlaceOrderTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/SetPaymentMethodAndPlaceOrderTest.php index aff124c522309..543ce6fe9c8e7 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/SetPaymentMethodAndPlaceOrderTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/SetPaymentMethodAndPlaceOrderTest.php @@ -136,11 +136,12 @@ public function dataProviderSetPaymentOnCartWithException(): array 'payment_method: { code: "' . Checkmo::PAYMENT_METHOD_CHECKMO_CODE . '" }', - 'Required parameter "cart_id" is missing', + 'Field SetPaymentMethodAndPlaceOrderInput.cart_id of required type String! was not provided.', ], 'missed_payment_method' => [ 'cart_id: "cart_id_value"', - 'Required parameter "code" for "payment_method" is missing.', + 'Field SetPaymentMethodAndPlaceOrderInput.payment_method of required type PaymentMethodInput!' + . ' was not provided.', ], 'place_order_with_out_of_stock_products' => [ 'cart_id: "cart_id_value" diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/SetPaymentMethodOnCartTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/SetPaymentMethodOnCartTest.php index efda719ca153c..da190be333600 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/SetPaymentMethodOnCartTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/SetPaymentMethodOnCartTest.php @@ -235,11 +235,11 @@ public function dataProviderSetPaymentMethodWithoutRequiredParameters(): array return [ 'missed_cart_id' => [ 'payment_method: {code: "' . Checkmo::PAYMENT_METHOD_CHECKMO_CODE . '"}', - 'Required parameter "cart_id" is missing.' + 'Field SetPaymentMethodOnCartInput.cart_id of required type String! was not provided.' ], 'missed_payment_method' => [ 'cart_id: "cart_id_value"', - 'Required parameter "code" for "payment_method" is missing.' + 'Field SetPaymentMethodOnCartInput.payment_method of required type PaymentMethodInput! was not provided' ], 'missed_payment_method_code' => [ 'cart_id: "cart_id_value", payment_method: {code: ""}', diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/SetShippingAddressOnCartTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/SetShippingAddressOnCartTest.php index 8d9388c064226..47a3a13f05221 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/SetShippingAddressOnCartTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/SetShippingAddressOnCartTest.php @@ -464,21 +464,16 @@ public function testSetNewShippingAddressWithMissedRequiredParameters(string $in /** * Covers case with empty street * - * @todo Unskip case with missing "street" parameter https://github.com/magento/graphql-ce/issues/1033 - * * @magentoApiDataFixture Magento/Customer/_files/customer.php * @magentoApiDataFixture Magento/GraphQl/Catalog/_files/simple_product.php * @magentoApiDataFixture Magento/GraphQl/Quote/_files/customer/create_empty_cart.php * @magentoApiDataFixture Magento/GraphQl/Quote/_files/add_simple_product.php * - * @expectedException \Magento\Framework\GraphQl\Exception\GraphQlInputException - * @expectedExceptionMessage Required parameter "street" is missing + * @expectedException \Exception + * @expectedExceptionMessage Field CartAddressInput.street of required type [String]! was not provided. */ public function testSetNewShippingAddressWithMissedRequiredStreetParameters() { - $this->markTestSkipped( - 'Notice: Undefined index: street https://github.com/magento/graphql-ce/issues/1033' - ); $maskedQuoteId = $this->getMaskedQuoteIdByReservedOrderId->execute('test_quote'); $query = << [ 'shipping_addresses: {}', - 'Required parameter "cart_id" is missing' + 'Field SetShippingAddressesOnCartInput.cart_id of required type String! was not provided.' ], 'missed_region' => [ 'cart_id: "cart_id_value" diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/SetShippingMethodsOnCartTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/SetShippingMethodsOnCartTest.php index 278f21f30b72d..149a2fbb1da32 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/SetShippingMethodsOnCartTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/SetShippingMethodsOnCartTest.php @@ -174,11 +174,12 @@ public function dataProviderSetShippingMethodWithWrongParameters(): array carrier_code: "flatrate" method_code: "flatrate" }]', - 'Required parameter "cart_id" is missing' + 'Field SetShippingMethodsOnCartInput.cart_id of required type String! was not provided.' ], 'missed_shipping_methods' => [ 'cart_id: "cart_id_value"', - 'Required parameter "shipping_methods" is missing' + 'Field SetShippingMethodsOnCartInput.shipping_methods of required type [ShippingMethodInput]!' + . ' was not provided.' ], 'shipping_methods_are_empty' => [ 'cart_id: "cart_id_value" shipping_methods: []', @@ -208,7 +209,7 @@ public function dataProviderSetShippingMethodWithWrongParameters(): array 'cart_id: "cart_id_value", shipping_methods: [{ carrier_code: "flatrate" }]', - 'Required parameter "method_code" is missing.' + 'Field ShippingMethodInput.method_code of required type String! was not provided.' ], 'empty_method_code' => [ 'cart_id: "cart_id_value", shipping_methods: [{ diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/UpdateCartItemsTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/UpdateCartItemsTest.php index 48ea4ab7a15e3..1ec2de36a0bc2 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/UpdateCartItemsTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/UpdateCartItemsTest.php @@ -212,7 +212,7 @@ public function testUpdateItemInAnotherCustomerCart() /** * @magentoApiDataFixture Magento/Customer/_files/customer.php * @expectedException \Exception - * @expectedExceptionMessage Required parameter "cart_id" is missing. + * @expectedExceptionMessage Field UpdateCartItemsInput.cart_id of required type String! was not provided. */ public function testUpdateWithMissedCartItemId() { @@ -277,11 +277,11 @@ public function dataProviderUpdateWithMissedRequiredParameters(): array return [ 'missed_cart_items' => [ '', - 'Required parameter "cart_items" is missing.' + 'Field UpdateCartItemsInput.cart_items of required type [CartItemUpdateInput]! was not provided.' ], 'missed_cart_item_id' => [ 'cart_items: [{ quantity: 2 }]', - 'Required parameter "cart_item_id" for "cart_items" is missing.' + 'Field CartItemUpdateInput.cart_item_id of required type Int! was not provided.' ], 'missed_cart_item_qty' => [ 'cart_items: [{ cart_item_id: 1 }]', diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/AddSimpleProductToCartTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/AddSimpleProductToCartTest.php index 022d5d54449d5..59f11be6d5b45 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/AddSimpleProductToCartTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/AddSimpleProductToCartTest.php @@ -81,7 +81,7 @@ public function testAddSimpleProductToCart() /** * @expectedException Exception - * @expectedExceptionMessage Required parameter "cart_id" is missing + * @expectedExceptionMessage Field AddSimpleProductsToCartInput.cart_id of required type String! was not provided. */ public function testAddSimpleProductToCartIfCartIdIsMissed() { @@ -130,10 +130,6 @@ public function testAddSimpleProductToCartIfCartIdIsEmpty() $this->graphQlMutation($query); } - /** - * @expectedException Exception - * @expectedExceptionMessage Required parameter "cart_items" is missing - */ public function testAddSimpleProductToCartIfCartItemsAreMissed() { $query = <<expectException(\Exception::class); + $this->expectExceptionMessage( + 'Field AddSimpleProductsToCartInput.cart_items of required type [SimpleProductCartItemInput]!' + . ' was not provided.' + ); $this->graphQlMutation($query); } diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/AddVirtualProductToCartTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/AddVirtualProductToCartTest.php index fb4c7b8b14d1b..c5723d137d070 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/AddVirtualProductToCartTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/AddVirtualProductToCartTest.php @@ -53,7 +53,7 @@ public function testAddVirtualProductToCart() /** * @expectedException Exception - * @expectedExceptionMessage Required parameter "cart_id" is missing + * @expectedExceptionMessage Field AddSimpleProductsToCartInput.cart_id of required type String! was not provided. */ public function testAddVirtualProductToCartIfCartIdIsMissed() { @@ -102,10 +102,6 @@ public function testAddVirtualProductToCartIfCartIdIsEmpty() $this->graphQlMutation($query); } - /** - * @expectedException Exception - * @expectedExceptionMessage Required parameter "cart_items" is missing - */ public function testAddVirtualProductToCartIfCartItemsAreMissed() { $query = <<expectException(\Exception::class); + $this->expectExceptionMessage( + 'Field AddSimpleProductsToCartInput.cart_items of required type [SimpleProductCartItemInput]!' + . ' was not provided.' + ); + $this->graphQlMutation($query); } diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/ApplyCouponToCartTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/ApplyCouponToCartTest.php index c94e5cc52edbb..865837e6bd629 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/ApplyCouponToCartTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/ApplyCouponToCartTest.php @@ -184,11 +184,11 @@ public function dataProviderUpdateWithMissedRequiredParameters(): array return [ 'missed_cart_id' => [ 'coupon_code: "test"', - 'Required parameter "cart_id" is missing' + 'Field ApplyCouponToCartInput.cart_id of required type String! was not provided.' ], 'missed_coupon_code' => [ 'cart_id: "test_quote"', - 'Required parameter "coupon_code" is missing' + 'Field ApplyCouponToCartInput.coupon_code of required type String! was not provided.' ], ]; } diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/ApplyCouponsToCartTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/ApplyCouponsToCartTest.php index 9adafa7e097f2..7d5e21cd25b8a 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/ApplyCouponsToCartTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/ApplyCouponsToCartTest.php @@ -161,11 +161,11 @@ public function dataProviderUpdateWithMissedRequiredParameters(): array return [ 'missed_cart_id' => [ 'coupon_code: "test"', - 'Required parameter "cart_id" is missing' + 'Field ApplyCouponToCartInput.cart_id of required type String! was not provided.' ], 'missed_coupon_code' => [ 'cart_id: "test_quote"', - 'Required parameter "coupon_code" is missing' + 'Field ApplyCouponToCartInput.coupon_code of required type String! was not provided.' ], ]; } diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/PlaceOrderTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/PlaceOrderTest.php index 52caf836d3b46..c6c1d3be99c59 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/PlaceOrderTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/PlaceOrderTest.php @@ -97,7 +97,7 @@ public function testPlaceOrderIfCartIdIsEmpty() /** * @expectedException Exception - * @expectedExceptionMessage Required parameter "cart_id" is missing + * @expectedExceptionMessage Field PlaceOrderInput.cart_id of required type String! was not provided. */ public function testPlaceOrderIfCartIdIsMissed() { diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/RemoveCouponFromCartTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/RemoveCouponFromCartTest.php index 57a13e2f1bc03..12c3918fcd0ac 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/RemoveCouponFromCartTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/RemoveCouponFromCartTest.php @@ -63,7 +63,7 @@ public function testRemoveCouponFromCartIfCartIdIsEmpty() /** * @expectedException Exception - * @expectedExceptionMessage Required parameter "cart_id" is missing + * @expectedExceptionMessage Field RemoveCouponFromCartInput.cart_id of required type String! was not provided. */ public function testRemoveCouponFromCartIfCartIdIsMissed() { diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/RemoveItemFromCartTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/RemoveItemFromCartTest.php index 7e3d3553ba2f3..c3a66291251c7 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/RemoveItemFromCartTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/RemoveItemFromCartTest.php @@ -114,11 +114,11 @@ public function dataProviderUpdateWithMissedRequiredParameters(): array return [ 'missed_cart_id' => [ 'cart_item_id: 1', - 'Required parameter "cart_id" is missing.' + 'Field RemoveItemFromCartInput.cart_id of required type String! was not provided.' ], 'missed_cart_item_id' => [ 'cart_id: "test_quote"', - 'Required parameter "cart_item_id" is missing.' + 'Field RemoveItemFromCartInput.cart_item_id of required type Int! was not provided.' ], ]; } diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/SetBillingAddressOnCartTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/SetBillingAddressOnCartTest.php index 5f9f44084c8a9..87335bd5c96dd 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/SetBillingAddressOnCartTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/SetBillingAddressOnCartTest.php @@ -343,7 +343,7 @@ public function dataProviderSetWithoutRequiredParameters(): array ], 'missed_cart_id' => [ 'billing_address: {}', - 'Required parameter "cart_id" is missing' + 'Field SetBillingAddressOnCartInput.cart_id of required type String! was not provided.' ] ]; } diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/SetPaymentMethodOnCartTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/SetPaymentMethodOnCartTest.php index fdec9a1dd9853..24ba3e78f9b4e 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/SetPaymentMethodOnCartTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/SetPaymentMethodOnCartTest.php @@ -185,11 +185,11 @@ public function dataProviderSetPaymentMethodWithoutRequiredParameters(): array return [ 'missed_cart_id' => [ 'payment_method: {code: "' . Checkmo::PAYMENT_METHOD_CHECKMO_CODE . '"}', - 'Required parameter "cart_id" is missing.' + 'Field SetPaymentMethodOnCartInput.cart_id of required type String! was not provided.' ], 'missed_payment_method' => [ 'cart_id: "cart_id_value"', - 'Required parameter "code" for "payment_method" is missing.' + 'Field SetPaymentMethodOnCartInput.payment_method of required type PaymentMethodInput! was not provided' ], 'missed_payment_method_code' => [ 'cart_id: "cart_id_value", payment_method: {code: ""}', diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/SetShippingAddressOnCartTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/SetShippingAddressOnCartTest.php index 0b2e67c5650c0..b142de71e89a3 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/SetShippingAddressOnCartTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/SetShippingAddressOnCartTest.php @@ -302,7 +302,7 @@ public function dataProviderUpdateWithMissedRequiredParameters(): array ], 'missed_cart_id' => [ 'shipping_addresses: {}', - 'Required parameter "cart_id" is missing' + 'Field SetShippingAddressesOnCartInput.cart_id of required type String! was not provided.' ] ]; } diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/SetShippingMethodsOnCartTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/SetShippingMethodsOnCartTest.php index 117aedf59b5a5..007ada1ce57cf 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/SetShippingMethodsOnCartTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/SetShippingMethodsOnCartTest.php @@ -191,11 +191,12 @@ public function dataProviderSetShippingMethodWithWrongParameters(): array carrier_code: "flatrate" method_code: "flatrate" }]', - 'Required parameter "cart_id" is missing' + 'Field SetShippingMethodsOnCartInput.cart_id of required type String! was not provided.' ], 'missed_shipping_methods' => [ 'cart_id: "cart_id_value"', - 'Required parameter "shipping_methods" is missing' + 'Field SetShippingMethodsOnCartInput.shipping_methods of required type [ShippingMethodInput]!' + . ' was not provided.' ], 'shipping_methods_are_empty' => [ 'cart_id: "cart_id_value" shipping_methods: []', @@ -225,7 +226,7 @@ public function dataProviderSetShippingMethodWithWrongParameters(): array 'cart_id: "cart_id_value", shipping_methods: [{ carrier_code: "flatrate" }]', - 'Required parameter "method_code" is missing.' + 'Field ShippingMethodInput.method_code of required type String! was not provided.' ], 'empty_method_code' => [ 'cart_id: "cart_id_value", shipping_methods: [{ diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/UpdateCartItemsTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/UpdateCartItemsTest.php index 6ac683ef77ade..48d58a0dd8f17 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/UpdateCartItemsTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/UpdateCartItemsTest.php @@ -183,7 +183,7 @@ public function testUpdateItemFromCustomerCart() /** * @expectedException \Exception - * @expectedExceptionMessage Required parameter "cart_id" is missing. + * @expectedExceptionMessage Field UpdateCartItemsInput.cart_id of required type String! was not provided. */ public function testUpdateWithMissedCartItemId() { @@ -248,11 +248,11 @@ public function dataProviderUpdateWithMissedRequiredParameters(): array return [ 'missed_cart_items' => [ '', - 'Required parameter "cart_items" is missing.' + 'Field UpdateCartItemsInput.cart_items of required type [CartItemUpdateInput]! was not provided.' ], 'missed_cart_item_id' => [ 'cart_items: [{ quantity: 2 }]', - 'Required parameter "cart_item_id" for "cart_items" is missing.' + 'Field CartItemUpdateInput.cart_item_id of required type Int! was not provided.' ], 'missed_cart_item_qty' => [ 'cart_items: [{ cart_item_id: 1 }]', diff --git a/dev/tests/integration/testsuite/Magento/PaypalGraphQl/Model/Resolver/Customer/PlaceOrderWithPayflowLinkTest.php b/dev/tests/integration/testsuite/Magento/PaypalGraphQl/Model/Resolver/Customer/PlaceOrderWithPayflowLinkTest.php index 51745fb6aaf9a..b5f097cceb189 100644 --- a/dev/tests/integration/testsuite/Magento/PaypalGraphQl/Model/Resolver/Customer/PlaceOrderWithPayflowLinkTest.php +++ b/dev/tests/integration/testsuite/Magento/PaypalGraphQl/Model/Resolver/Customer/PlaceOrderWithPayflowLinkTest.php @@ -123,6 +123,7 @@ public function testResolvePlaceOrderWithPayflowLinkForCustomer(): void { cancel_url:"paypal/payflow/cancelPayment" return_url:"paypal/payflow/returnUrl" + error_url:"paypal/payflow/errorUrl" } } }) { diff --git a/lib/internal/Magento/Framework/GraphQl/Config.php b/lib/internal/Magento/Framework/GraphQl/Config.php index ec22b742b1d6c..fa0a5cf1cd1eb 100644 --- a/lib/internal/Magento/Framework/GraphQl/Config.php +++ b/lib/internal/Magento/Framework/GraphQl/Config.php @@ -62,13 +62,9 @@ public function getConfigElement(string $configElementName) : ConfigElementInter $fieldsInQuery = $this->queryFields->getFieldsUsedInQuery(); if (isset($data['fields'])) { if (!empty($fieldsInQuery)) { - foreach (array_keys($data['fields']) as $fieldName) { - if (!isset($fieldsInQuery[$fieldName])) { - unset($data['fields'][$fieldName]); - } - } + $data['fieldsInQuery'] = array_intersect_key($data['fields'], $fieldsInQuery); + ksort($data['fieldsInQuery']); } - ksort($data['fields']); } diff --git a/lib/internal/Magento/Framework/GraphQl/Config/Element/InterfaceFactory.php b/lib/internal/Magento/Framework/GraphQl/Config/Element/InterfaceFactory.php index ebf70478d4e43..d057408e3fbfa 100644 --- a/lib/internal/Magento/Framework/GraphQl/Config/Element/InterfaceFactory.php +++ b/lib/internal/Magento/Framework/GraphQl/Config/Element/InterfaceFactory.php @@ -47,11 +47,15 @@ public function __construct( /** * Instantiate an object representing 'interface' GraphQL config element. + * + * @param array $data + * @return ConfigElementInterface */ public function createFromConfigData(array $data): ConfigElementInterface { + $fieldsData = $data['fieldsInQuery'] ?? ($data['fields'] ?? []); $fields = []; - foreach ($data['fields'] as $field) { + foreach ($fieldsData as $field) { $arguments = []; foreach ($field['arguments'] as $argument) { $arguments[$argument['name']] = $this->argumentFactory->createFromConfigData($argument); diff --git a/lib/internal/Magento/Framework/GraphQl/Config/Element/TypeFactory.php b/lib/internal/Magento/Framework/GraphQl/Config/Element/TypeFactory.php index 5dd477a050890..33a6bbd7b6983 100644 --- a/lib/internal/Magento/Framework/GraphQl/Config/Element/TypeFactory.php +++ b/lib/internal/Magento/Framework/GraphQl/Config/Element/TypeFactory.php @@ -46,7 +46,8 @@ public function __construct( */ public function createFromConfigData(array $data): ConfigElementInterface { - $fields = isset($data['fields']) ? $this->fieldsFactory->createFromConfigData($data['fields']) : []; + $fieldsData = $data['fieldsInQuery'] ?? ($data['fields'] ?? []); + $fields = $this->fieldsFactory->createFromConfigData($fieldsData); return $this->create( $data,