From b9b55751d7c6161661f20a002b98e994fbf7186c Mon Sep 17 00:00:00 2001 From: Aakash Kumar Date: Tue, 12 Sep 2023 19:09:36 -0500 Subject: [PATCH 01/31] ACPT-1589: Add GraphQL P1 queries to GraphQlStateTest --- .../Magento/GraphQl/App/GraphQlStateTest.php | 261 +++++++++++++++++- .../GraphQl/_files/state-skip-list.php | 9 + 2 files changed, 268 insertions(+), 2 deletions(-) diff --git a/dev/tests/integration/testsuite/Magento/GraphQl/App/GraphQlStateTest.php b/dev/tests/integration/testsuite/Magento/GraphQl/App/GraphQlStateTest.php index 1f3ea9076d248..a240ffc6ebc98 100644 --- a/dev/tests/integration/testsuite/Magento/GraphQl/App/GraphQlStateTest.php +++ b/dev/tests/integration/testsuite/Magento/GraphQl/App/GraphQlStateTest.php @@ -16,6 +16,7 @@ use Magento\Framework\Registry; use Magento\GraphQl\App\State\Comparator; use Magento\GraphQl\App\State\ObjectManager; +use Magento\GraphQl\Quote\GetMaskedQuoteIdByReservedOrderId; use Magento\Integration\Api\CustomerTokenServiceInterface; use Magento\TestFramework\Helper\Bootstrap; @@ -52,6 +53,11 @@ class GraphQlStateTest extends \PHPUnit\Framework\TestCase /** @var Registry */ private $registry; + /** + * @var GetMaskedQuoteIdByReservedOrderId + */ + private $getMaskedQuoteIdByReservedOrderId; + /** * @inheritDoc */ @@ -64,6 +70,7 @@ protected function setUp(): void Bootstrap::setObjectManager($this->objectManagerForTest); $this->comparator = $this->objectManagerForTest->create(Comparator::class); $this->requestFactory = $this->objectManagerForTest->get(RequestFactory::class); + $this->getMaskedQuoteIdByReservedOrderId = $this->objectManagerForTest->get(GetMaskedQuoteIdByReservedOrderId::class); $this->objectManagerForTest->resetStateSharedInstances(); parent::setUp(); } @@ -114,7 +121,21 @@ public function testCustomerState( /** * Runs various GraphQL queries and checks if state of shared objects in Object Manager have changed - * + * @magentoDataFixture Magento/Store/_files/store.php + * @magentoConfigFixture default_store catalog/seo/product_url_suffix test_product_suffix + * @magentoConfigFixture default_store catalog/seo/category_url_suffix test_category_suffix + * @magentoConfigFixture default_store catalog/seo/title_separator ___ + * @magentoConfigFixture default_store catalog/frontend/list_mode 2 + * @magentoConfigFixture default_store catalog/frontend/grid_per_page_values 16 + * @magentoConfigFixture default_store catalog/frontend/list_per_page_values 8 + * @magentoConfigFixture default_store catalog/frontend/grid_per_page 16 + * @magentoConfigFixture default_store catalog/frontend/list_per_page 8 + * @magentoConfigFixture default_store catalog/frontend/default_sort_by asc + * @magentoDataFixture Magento/GraphQl/Catalog/_files/simple_product.php + * @magentoDataFixture Magento/GraphQl/Quote/_files/guest/create_empty_cart.php + * @magentoDataFixture Magento/GraphQl/Quote/_files/add_simple_product.php + * @magentoDataFixture Magento/GraphQl/Quote/_files/set_new_shipping_address.php + * @magentoDataFixture Magento/GraphQl/Quote/_files/set_new_billing_address.php * @dataProvider queryDataProvider * @param string $query * @param array $variables @@ -140,6 +161,9 @@ public function testState( $authInfo1 = $authInfo; $authInfo2 = $authInfo; } + if ($operationName == 'getCart') { + $variables['id'] = $this->getMaskedQuoteIdByReservedOrderId->execute($variables['id']); + } $jsonEncodedRequest = json_encode([ 'query' => $query, 'variables' => $variables, @@ -449,6 +473,211 @@ public function queryDataProvider(): array 'resolveUrl', '"type":"CMS_PAGE","id":1' ], + 'Get available Stores' => [ + <<<'QUERY' + query availableStores($currentGroup: Boolean!) { + availableStores(useCurrentGroup:$currentGroup) { + id, + code, + store_code, + store_name, + store_sort_order, + is_default_store, + store_group_code, + store_group_name, + is_default_store_group, + website_id, + website_code, + website_name, + locale, + base_currency_code, + default_display_currency_code, + timezone, + weight_unit, + base_url, + base_link_url, + base_media_url, + secure_base_url, + secure_base_link_url, + secure_base_static_url, + secure_base_media_url, + store_name + use_store_in_url + } + } + QUERY, + ['currentGroup' => true], + [], + [], + 'availableStores', + '"store_code":"default"' + ], + 'Get store config' => [ + <<<'QUERY' + query { + storeConfig { + product_url_suffix, + category_url_suffix, + title_separator, + list_mode, + grid_per_page_values, + list_per_page_values, + grid_per_page, + list_per_page, + catalog_default_sort_by, + root_category_id + root_category_uid + } + } + QUERY, + [], + [], + [], + 'storeConfig', + '"storeConfig":{"product_url_suffix":"test_product_suffix"' + ], + 'Get Categories by name' => [ + <<<'QUERY' + query categories($name: String!) { + categories(filters: {name: {match: $name}} + pageSize: 3 + currentPage: 3 + ) { + total_count + page_info { + current_page + page_size + total_pages + + } + items { + name + } + } + } + QUERY, + ['name' => 'Category'], + [], + [], + 'categories', + '"data":{"categories"' + ], + 'Get Products by name' => [ + <<<'QUERY' + query products($name: String!) { + products( + search: $name + filter: {} + pageSize: 1000 + currentPage: 1 + sort: {name: ASC} + ) { + + items { + name + image + { + url + } + attribute_set_id + canonical_url + color + country_of_manufacture + created_at + gift_message_available + id + is_returnable + manufacturer + meta_description + meta_keyword + meta_title + new_from_date + new_to_date + only_x_left_in_stock + options_container + rating_summary + review_count + sku + special_price + special_to_date + staged + stock_status + swatch_image + uid + updated_at + url_key + url_path + url_suffix + + } + page_info { + current_page + page_size + total_pages + } + sort_fields { + default + } + suggestions { + search + } + total_count + } + } + QUERY, + ['name' => 'Simple Product1'], + [], + [], + 'products', + '"data":{"products":{"items":[{' + ], + 'Get Cart' => [ + <<<'QUERY' + query cart($id: String!) { + cart(cart_id: $id) { + applied_coupons { + code + } + + available_payment_methods { + code + is_deferred + title + } + billing_address { + city + company + firstname + lastname + postcode + street + telephone + uid + vat_id + } + email + id + is_virtual + items { + id + quantity + uid + } + selected_payment_method { + code + purchase_order_number + title + } + total_quantity + } + } + QUERY, + ['id' => 'test_quote'], + [], + [], + 'getCart', + '"cart":{"applied_coupons":null,"available_payment_methods":[{"code":"checkmo"' + ], ]; } @@ -618,7 +847,35 @@ public function customerDataProvider(): array [], 'generateCustomerToken', 'token' - ] + ], + 'Get Customer' => [ + <<<'QUERY' + query { + customer { + created_at + date_of_birth + default_billing + default_shipping + date_of_birth + email + firstname + gender + id + is_subscribed + lastname + middlename + prefix + suffix + taxvat + } + } + QUERY, + [], + [], + ['email' => 'customer@example.com', 'password' => 'password'], + 'getCustomer', + '"data":{"customer":{"created_at"' + ], ]; } } diff --git a/dev/tests/integration/testsuite/Magento/GraphQl/_files/state-skip-list.php b/dev/tests/integration/testsuite/Magento/GraphQl/_files/state-skip-list.php index b9e61ad57de92..2cc86f8921a9f 100644 --- a/dev/tests/integration/testsuite/Magento/GraphQl/_files/state-skip-list.php +++ b/dev/tests/integration/testsuite/Magento/GraphQl/_files/state-skip-list.php @@ -459,6 +459,15 @@ Magento\Framework\Webapi\ServiceInputProcessor::class => null, Magento\Framework\MessageQueue\Publisher\Config\RemoteService\Reader::class => null, ], + 'getCustomer' => [ + Magento\JwtUserToken\Model\ConfigurableJwtSettingsProvider::class => null, + Magento\JwtUserToken\Model\Reader::class => null, + ], + 'getCart' => [ + Magento\Framework\Model\ResourceModel\Db\VersionControl\Metadata::class => null, + Magento\Framework\Model\ResourceModel\Db\VersionControl\Snapshot::class => null, + Laminas\Uri\Uri::class => null, + ], '*' => [ Magento\TestFramework\Interception\PluginList::class => null, // memory leak, wrong sql, potential issues From 1f918573c2ec16b2c7c7f61b2f1ef7727ef14bdc Mon Sep 17 00:00:00 2001 From: Aakash Kumar Date: Fri, 15 Sep 2023 11:51:09 -0500 Subject: [PATCH 02/31] ACPT-1589: Add GraphQL P1 queries to GraphQlStateTest --- .../Magento/GraphQl/App/GraphQlStateTest.php | 2 -- .../GraphQl/App/State/ObjectManager.php | 2 ++ .../GraphQl/_files/state-skip-list.php | 26 +++++++++++++++++++ 3 files changed, 28 insertions(+), 2 deletions(-) diff --git a/dev/tests/integration/testsuite/Magento/GraphQl/App/GraphQlStateTest.php b/dev/tests/integration/testsuite/Magento/GraphQl/App/GraphQlStateTest.php index a240ffc6ebc98..eda50de43447f 100644 --- a/dev/tests/integration/testsuite/Magento/GraphQl/App/GraphQlStateTest.php +++ b/dev/tests/integration/testsuite/Magento/GraphQl/App/GraphQlStateTest.php @@ -586,7 +586,6 @@ public function queryDataProvider(): array created_at gift_message_available id - is_returnable manufacturer meta_description meta_keyword @@ -600,7 +599,6 @@ public function queryDataProvider(): array sku special_price special_to_date - staged stock_status swatch_image uid diff --git a/dev/tests/integration/testsuite/Magento/GraphQl/App/State/ObjectManager.php b/dev/tests/integration/testsuite/Magento/GraphQl/App/State/ObjectManager.php index 52446dee26b1a..4849dbf16f909 100644 --- a/dev/tests/integration/testsuite/Magento/GraphQl/App/State/ObjectManager.php +++ b/dev/tests/integration/testsuite/Magento/GraphQl/App/State/ObjectManager.php @@ -29,6 +29,8 @@ public function __construct(TestFrameworkObjectManager $testFrameworkObjectManag foreach ($properties as $key => $value) { $this->$key = $value; } + $this->_sharedInstances['Magento\Framework\ObjectManagerInterface'] = $this; + $this->_sharedInstances['Magento\Framework\App\ObjectManager'] = $this; $this->_factory = new DynamicFactoryDecorator($this->_factory, $this); } diff --git a/dev/tests/integration/testsuite/Magento/GraphQl/_files/state-skip-list.php b/dev/tests/integration/testsuite/Magento/GraphQl/_files/state-skip-list.php index 2cc86f8921a9f..aa9339618de22 100644 --- a/dev/tests/integration/testsuite/Magento/GraphQl/_files/state-skip-list.php +++ b/dev/tests/integration/testsuite/Magento/GraphQl/_files/state-skip-list.php @@ -28,6 +28,12 @@ 'productDetail' => [ Magento\Framework\GraphQl\Query\Fields::class => null, ], + 'products' => [ + Magento\Catalog\Model\Config::class => null, + Magento\Catalog\Model\Category\Attribute\Source\Sortby::class => null, + Magento\CatalogInventory\Model\StockRegistryProvider::class => null, + Magento\CatalogInventory\Model\StockRegistry::class => null, + ], 'resolveUrl' => [ Magento\Framework\GraphQl\Query\Fields::class => null, ], @@ -467,8 +473,28 @@ Magento\Framework\Model\ResourceModel\Db\VersionControl\Metadata::class => null, Magento\Framework\Model\ResourceModel\Db\VersionControl\Snapshot::class => null, Laminas\Uri\Uri::class => null, + Magento\Framework\Reflection\MethodsMap::class => null, + Magento\Framework\Reflection\DataObjectProcessor::class => null, + Magento\Framework\Api\DataObjectHelper::class => null, + Magento\Framework\Translate\Inline::class => null, + Magento\Framework\Json\Encoder::class => null, + Magento\Quote\Model\Quote\Address\Total\Collector::class => null, + Magento\Quote\Model\Quote\TotalsCollectorList::class => null, + Magento\Quote\Model\Quote\TotalsCollector::class => null, + Magento\Payment\Model\MethodList::class => null, + Magento\Quote\Model\PaymentMethodManagement::class => null, + Magento\Quote\Model\Quote\Interceptor::class => null, + Magento\Quote\Model\ResourceModel\Quote\Item\Collection\Interceptor::class => null, + Magento\User\Model\User\Interceptor::class => null, + Magento\Quote\Model\ShippingAssignment::class => null, + Magento\Quote\Model\Shipping::class => null, + Magento\Framework\ObjectManager\TMap::class => null, + Magento\Payment\Gateway\Config\ValueHandlerPool::class => null, + Magento\Payment\Model\Method\Adapter::class => null, ], '*' => [ + Magento\Framework\Model\ResourceModel\Db\VersionControl\Metadata::class => null, + Magento\Framework\Model\ResourceModel\Db\VersionControl\Snapshot::class => null, Magento\TestFramework\Interception\PluginList::class => null, // memory leak, wrong sql, potential issues Magento\Framework\Event\Config\Data::class => null, From ec282aca23698b3428555411d4c6960ff472010b Mon Sep 17 00:00:00 2001 From: Aakash Kumar Date: Wed, 20 Sep 2023 23:05:50 -0500 Subject: [PATCH 03/31] ACPT-1589: Add GraphQL P1 queries to GraphQlStateTest --- .../Magento/GraphQl/App/GraphQlStateDiff.php | 171 ++++++++++++++++++ .../Magento/GraphQl/App/GraphQlStateTest.php | 112 ++---------- .../GraphQl/App/State/ObjectManager.php | 2 + .../GraphQl/_files/state-skip-list.php | 4 + 4 files changed, 188 insertions(+), 101 deletions(-) create mode 100644 dev/tests/integration/testsuite/Magento/GraphQl/App/GraphQlStateDiff.php diff --git a/dev/tests/integration/testsuite/Magento/GraphQl/App/GraphQlStateDiff.php b/dev/tests/integration/testsuite/Magento/GraphQl/App/GraphQlStateDiff.php new file mode 100644 index 0000000000000..863b6dd1e3294 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/GraphQl/App/GraphQlStateDiff.php @@ -0,0 +1,171 @@ +objectManagerBeforeTest = Bootstrap::getObjectManager(); + $this->objectManagerForTest = new ObjectManager($this->objectManagerBeforeTest); + $this->objectManagerForTest->getFactory()->setObjectManager($this->objectManagerForTest); + AppObjectManager::setInstance($this->objectManagerForTest); + Bootstrap::setObjectManager($this->objectManagerForTest); + $this->comparator = $this->objectManagerForTest->create(Comparator::class); + $this->requestFactory = $this->objectManagerForTest->get(RequestFactory::class); + $this->objectManagerForTest->resetStateSharedInstances(); + } + + public function getTestObjectManager() + { + return $this->objectManagerForTest; + } + + public function tearDown(): void + { + $this->objectManagerBeforeTest->getFactory()->setObjectManager($this->objectManagerBeforeTest); + AppObjectManager::setInstance($this->objectManagerBeforeTest); + Bootstrap::setObjectManager($this->objectManagerBeforeTest); + } + + public function testState( + string $query, + array $variables, + array $variables2, + array $authInfo, + string $operationName, + string $expected, + TestCase $test + ): void { + if (array_key_exists(1, $authInfo)) { + $authInfo1 = $authInfo[0]; + $authInfo2 = $authInfo[1]; + } else { + $authInfo1 = $authInfo; + $authInfo2 = $authInfo; + } + if ($operationName == 'getCart') { + $variables['id'] = $this->getMaskedQuoteIdByReservedOrderId->execute($variables['id']); + } + $jsonEncodedRequest = json_encode([ + 'query' => $query, + 'variables' => $variables, + 'operationName' => $operationName + ]); + $output1 = $this->request($jsonEncodedRequest, $operationName, $authInfo1, $test,true); + $test->assertStringContainsString($expected, $output1); + if ($variables2) { + $jsonEncodedRequest = json_encode([ + 'query' => $query, + 'variables' => $variables2, + 'operationName' => $operationName + ]); + } + $output2 = $this->request($jsonEncodedRequest, $operationName, $authInfo2, $test); + $test->assertStringContainsString($expected, $output2); + } + + /** + * @param string $query + * @param string $operationName + * @param array $authInfo + * @param bool $firstRequest + * @return array + * @throws \Exception + */ + public function request(string $query, string $operationName, array $authInfo, TestCase $test, bool $firstRequest = false): string + { + $this->objectManagerForTest->resetStateSharedInstances(); + $this->comparator->rememberObjectsStateBefore($firstRequest); + $response = $this->doRequest($query, $authInfo); + $this->objectManagerForTest->resetStateSharedInstances(); + $this->comparator->rememberObjectsStateAfter($firstRequest); + $result = $this->comparator->compareBetweenRequests($operationName); + $test->assertEmpty( + $result, + sprintf( + '%d objects changed state during request. Details: %s', + count($result), + var_export($result, true) + ) + ); + $result = $this->comparator->compareConstructedAgainstCurrent($operationName); + $test->assertEmpty( + $result, + sprintf( + '%d objects changed state since constructed. Details: %s', + count($result), + var_export($result, true) + ) + ); + return $response; + } + + /** + * Process the GraphQL request + * + * @param string $query + * @return string + */ + private function doRequest(string $query, array $authInfo) + { + $request = $this->requestFactory->create(); + $request->setContent($query); + $request->setMethod('POST'); + $request->setPathInfo('/graphql'); + $request->getHeaders()->addHeaders(['content_type' => self::CONTENT_TYPE]); + if ($authInfo) { + $email = $authInfo['email']; + $password = $authInfo['password']; + $customerToken = $this->objectManagerForTest->get(CustomerTokenServiceInterface::class) + ->createCustomerAccessToken($email, $password); + $request->getHeaders()->addHeaders(['Authorization' => 'Bearer ' . $customerToken]); + } + $unusedResponse = $this->objectManagerForTest->create(HttpResponse::class); + $httpApp = $this->objectManagerForTest->create( + HttpApp::class, + ['request' => $request, 'response' => $unusedResponse] + ); + $actualResponse = $httpApp->launch(); + return $actualResponse->getContent(); + } +} diff --git a/dev/tests/integration/testsuite/Magento/GraphQl/App/GraphQlStateTest.php b/dev/tests/integration/testsuite/Magento/GraphQl/App/GraphQlStateTest.php index eda50de43447f..27e5a66634a87 100644 --- a/dev/tests/integration/testsuite/Magento/GraphQl/App/GraphQlStateTest.php +++ b/dev/tests/integration/testsuite/Magento/GraphQl/App/GraphQlStateTest.php @@ -8,17 +8,8 @@ namespace Magento\GraphQl\App; use Magento\Customer\Api\CustomerRepositoryInterface; -use Magento\Framework\App\Http as HttpApp; -use Magento\Framework\App\ObjectManager as AppObjectManager; -use Magento\Framework\App\Request\HttpFactory as RequestFactory; -use Magento\Framework\App\Response\Http as HttpResponse; -use Magento\Framework\ObjectManagerInterface; use Magento\Framework\Registry; -use Magento\GraphQl\App\State\Comparator; -use Magento\GraphQl\App\State\ObjectManager; use Magento\GraphQl\Quote\GetMaskedQuoteIdByReservedOrderId; -use Magento\Integration\Api\CustomerTokenServiceInterface; -use Magento\TestFramework\Helper\Bootstrap; /** * Tests the dispatch method in the GraphQl Controller class using a simple product query @@ -33,19 +24,7 @@ */ class GraphQlStateTest extends \PHPUnit\Framework\TestCase { - private const CONTENT_TYPE = 'application/json'; - /** @var ObjectManagerInterface */ - private ObjectManagerInterface $objectManagerBeforeTest; - - /** @var ObjectManager */ - private ObjectManager $objectManagerForTest; - - /** @var Comparator */ - private Comparator $comparator; - - /** @var RequestFactory */ - private RequestFactory $requestFactory; /** @var CustomerRepositoryInterface */ private CustomerRepositoryInterface $customerRepository; @@ -58,20 +37,16 @@ class GraphQlStateTest extends \PHPUnit\Framework\TestCase */ private $getMaskedQuoteIdByReservedOrderId; + private $graphQlStateDiff; + /** * @inheritDoc */ protected function setUp(): void { - $this->objectManagerBeforeTest = Bootstrap::getObjectManager(); - $this->objectManagerForTest = new ObjectManager($this->objectManagerBeforeTest); - $this->objectManagerForTest->getFactory()->setObjectManager($this->objectManagerForTest); - AppObjectManager::setInstance($this->objectManagerForTest); - Bootstrap::setObjectManager($this->objectManagerForTest); - $this->comparator = $this->objectManagerForTest->create(Comparator::class); - $this->requestFactory = $this->objectManagerForTest->get(RequestFactory::class); - $this->getMaskedQuoteIdByReservedOrderId = $this->objectManagerForTest->get(GetMaskedQuoteIdByReservedOrderId::class); - $this->objectManagerForTest->resetStateSharedInstances(); + $this->graphQlStateDiff = new GraphQlStateDiff(); +// $this->getMaskedQuoteIdByReservedOrderId = +// $this->graphQlStateDiff->getTestObjectManager()->get(GetMaskedQuoteIdByReservedOrderId::class); parent::setUp(); } @@ -80,9 +55,7 @@ protected function setUp(): void */ protected function tearDown(): void { - $this->objectManagerBeforeTest->getFactory()->setObjectManager($this->objectManagerBeforeTest); - AppObjectManager::setInstance($this->objectManagerBeforeTest); - Bootstrap::setObjectManager($this->objectManagerBeforeTest); + $this->graphQlStateDiff->tearDown(); parent::tearDown(); } @@ -102,8 +75,9 @@ public function testCustomerState( string $expected, ) : void { if ($operationName === 'createCustomer') { - $this->customerRepository = $this->objectManagerForTest->get(CustomerRepositoryInterface::class); - $this->registry = $this->objectManagerForTest->get(Registry::class); + $this->customerRepository = $this->graphQlStateDiff->getTestObjectManager() + ->get(CustomerRepositoryInterface::class); + $this->registry = $this->graphQlStateDiff->getTestObjectManager()->get(Registry::class); $this->registry->register('isSecureArea', true); try { $customer = $this->customerRepository->get($variables['email']); @@ -116,7 +90,8 @@ public function testCustomerState( $this->registry->unregister('isSecureArea', false); } } - $this->testState($query, $variables, $variables2, $authInfo, $operationName, $expected); + $this->graphQlStateDiff-> + testState($query, $variables, $variables2, $authInfo, $operationName, $expected, $this); } /** @@ -182,71 +157,6 @@ public function testState( $this->assertStringContainsString($expected, $output2); } - /** - * @param string $query - * @param string $operationName - * @param array $authInfo - * @param bool $firstRequest - * @return string - * @throws \Exception - */ - private function request(string $query, string $operationName, array $authInfo, bool $firstRequest = false): string - { - $this->objectManagerForTest->resetStateSharedInstances(); - $this->comparator->rememberObjectsStateBefore($firstRequest); - $response = $this->doRequest($query, $authInfo); - $this->objectManagerForTest->resetStateSharedInstances(); - $this->comparator->rememberObjectsStateAfter($firstRequest); - $result = $this->comparator->compareBetweenRequests($operationName); - $this->assertEmpty( - $result, - sprintf( - '%d objects changed state during request. Details: %s', - count($result), - var_export($result, true) - ) - ); - $result = $this->comparator->compareConstructedAgainstCurrent($operationName); - $this->assertEmpty( - $result, - sprintf( - '%d objects changed state since constructed. Details: %s', - count($result), - var_export($result, true) - ) - ); - return $response; - } - - /** - * Process the GraphQL request - * - * @param string $query - * @return string - */ - private function doRequest(string $query, array $authInfo) - { - $request = $this->requestFactory->create(); - $request->setContent($query); - $request->setMethod('POST'); - $request->setPathInfo('/graphql'); - $request->getHeaders()->addHeaders(['content_type' => self::CONTENT_TYPE]); - if ($authInfo) { - $email = $authInfo['email']; - $password = $authInfo['password']; - $customerToken = $this->objectManagerForTest->get(CustomerTokenServiceInterface::class) - ->createCustomerAccessToken($email, $password); - $request->getHeaders()->addHeaders(['Authorization' => 'Bearer ' . $customerToken]); - } - $unusedResponse = $this->objectManagerForTest->create(HttpResponse::class); - $httpApp = $this->objectManagerForTest->create( - HttpApp::class, - ['request' => $request, 'response' => $unusedResponse] - ); - $actualResponse = $httpApp->launch(); - return $actualResponse->getContent(); - } - /** * Queries, variables, operation names, and expected responses for test * diff --git a/dev/tests/integration/testsuite/Magento/GraphQl/App/State/ObjectManager.php b/dev/tests/integration/testsuite/Magento/GraphQl/App/State/ObjectManager.php index 4849dbf16f909..fa204ed8d9d7b 100644 --- a/dev/tests/integration/testsuite/Magento/GraphQl/App/State/ObjectManager.php +++ b/dev/tests/integration/testsuite/Magento/GraphQl/App/State/ObjectManager.php @@ -31,6 +31,8 @@ public function __construct(TestFrameworkObjectManager $testFrameworkObjectManag } $this->_sharedInstances['Magento\Framework\ObjectManagerInterface'] = $this; $this->_sharedInstances['Magento\Framework\App\ObjectManager'] = $this; + unset($this->_sharedInstances['Magento\Framework\Interception\PluginListInterface']); + unset($this->_sharedInstances['Magento\TestFramework\Interception\PluginList']); $this->_factory = new DynamicFactoryDecorator($this->_factory, $this); } diff --git a/dev/tests/integration/testsuite/Magento/GraphQl/_files/state-skip-list.php b/dev/tests/integration/testsuite/Magento/GraphQl/_files/state-skip-list.php index aa9339618de22..0a699696f95b0 100644 --- a/dev/tests/integration/testsuite/Magento/GraphQl/_files/state-skip-list.php +++ b/dev/tests/integration/testsuite/Magento/GraphQl/_files/state-skip-list.php @@ -319,6 +319,8 @@ Magento\Framework\Module\ModuleList::class => null, Magento\Framework\Module\Manager::class => null, Magento\Framework\Translate\Inline\Proxy::class => null, + Magento\Customer\Model\Metadata\AddressMetadata::class => null, + Magento\Customer\Model\Metadata\AddressCachedMetadata::class => null, ], 'updateCustomerEmail' => [ Magento\Framework\Url\QueryParamsResolver::class => null, @@ -576,6 +578,8 @@ Magento\Framework\App\ResourceConnection\Interceptor::class => null, Magento\Framework\Session\SaveHandler::class => null, // TODO: check this Magento\TestFramework\Db\Adapter\Mysql\Interceptor::class => null, + Magento\Indexer\Model\Indexer::class => null, + Magento\Indexer\Model\Indexer\DependencyDecorator::class => null, ], '*-fromConstructed' => [ Magento\GraphQl\App\State\ObjectManager::class => null, From a3f88ee0371827332ba6a1dd0fe52628a7e281ce Mon Sep 17 00:00:00 2001 From: Aakash Kumar Date: Thu, 21 Sep 2023 10:28:01 -0500 Subject: [PATCH 04/31] ACPT-1589: Add GraphQL P1 queries to GraphQlStateTest --- .../App/GraphQlCustomerMutationsTest.php | 294 ++++++++++++++++++ .../Magento/GraphQl/App/GraphQlStateTest.php | 282 +---------------- .../App/{ => State}/GraphQlStateDiff.php | 7 +- 3 files changed, 298 insertions(+), 285 deletions(-) create mode 100644 dev/tests/integration/testsuite/Magento/GraphQl/App/GraphQlCustomerMutationsTest.php rename dev/tests/integration/testsuite/Magento/GraphQl/App/{ => State}/GraphQlStateDiff.php (95%) diff --git a/dev/tests/integration/testsuite/Magento/GraphQl/App/GraphQlCustomerMutationsTest.php b/dev/tests/integration/testsuite/Magento/GraphQl/App/GraphQlCustomerMutationsTest.php new file mode 100644 index 0000000000000..437495c96b1e2 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/GraphQl/App/GraphQlCustomerMutationsTest.php @@ -0,0 +1,294 @@ +graphQlStateDiff = new GraphQlStateDiff(); + parent::setUp(); + } + + /** + * @inheritDoc + */ + protected function tearDown(): void + { + $this->graphQlStateDiff->tearDown(); + parent::tearDown(); + } + + /** + * @magentoDataFixture Magento/Customer/_files/customer.php + * @magentoDataFixture Magento/Customer/_files/customer_address.php + * @dataProvider customerDataProvider + * @return void + * @throws \Exception + */ + public function testCustomerState( + string $query, + array $variables, + array $variables2, + array $authInfo, + string $operationName, + string $expected, + ) : void { + if ($operationName === 'createCustomer') { + $emails = [$variables['email'], $variables2['email']]; + $this->clearCustomerBeforeTest($emails); + } + $this->graphQlStateDiff-> + testState($query, $variables, $variables2, $authInfo, $operationName, $expected, $this); + } + + /** + * @param string $email + * @return void + */ + private function clearCustomerBeforeTest(array $emails ): void + { + $this->customerRepository = $this->graphQlStateDiff->getTestObjectManager() + ->get(CustomerRepositoryInterface::class); + $this->registry = $this->graphQlStateDiff->getTestObjectManager()->get(Registry::class); + $this->registry->register('isSecureArea', true); + try { + $customer = $this->customerRepository->get(array_pop($emails)); + $this->customerRepository->delete($customer); + $customer2 = $this->customerRepository->get(array_pop($emails)); + $this->customerRepository->delete($customer2); + } catch (\Exception $e) { + // Customer does not exist + } finally { + $this->registry->unregister('isSecureArea', false); + } + } + + /** + * Queries, variables, operation names, and expected responses for test + * + * @return array[] + * @SuppressWarnings(PHPMD.ExcessiveMethodLength) + */ + public function customerDataProvider(): array + { + return [ + 'Create Customer' => [ + <<<'QUERY' + mutation($firstname: String!, $lastname: String!, $email: String!, $password: String!) { + createCustomerV2( + input: { + firstname: $firstname, + lastname: $lastname, + email: $email, + password: $password + } + ) { + customer { + created_at + prefix + firstname + middlename + lastname + suffix + email + default_billing + default_shipping + date_of_birth + taxvat + is_subscribed + gender + allow_remote_shopping_assistance + } + } + } + QUERY, + [ + 'firstname' => 'John', + 'lastname' => 'Doe', + 'email' => 'email1@example.com', + 'password' => 'Password-1', + ], + [ + 'firstname' => 'John', + 'lastname' => 'Doe', + 'email' => 'email2@adobe.com', + 'password' => 'Password-2', + ], + [], + 'createCustomer', + '"email":"', + ], + 'Update Customer' => [ + <<<'QUERY' + mutation($allow: Boolean!) { + updateCustomerV2( + input: { + allow_remote_shopping_assistance: $allow + } + ) { + customer { + allow_remote_shopping_assistance + } + } + } + QUERY, + ['allow' => true], + ['allow' => false], + ['email' => 'customer@example.com', 'password' => 'password'], + 'updateCustomer', + 'allow_remote_shopping_assistance' + ], + 'Update Customer Address' => [ + <<<'QUERY' + mutation($addressId: Int!, $city: String!) { + updateCustomerAddress(id: $addressId, input: { + region: { + region: "Alberta" + region_id: 66 + region_code: "AB" + } + country_code: CA + street: ["Line 1 Street","Line 2"] + company: "Company Name" + telephone: "123456789" + fax: "123123123" + postcode: "7777" + city: $city + firstname: "Adam" + lastname: "Phillis" + middlename: "A" + prefix: "Mr." + suffix: "Jr." + vat_id: "1" + default_shipping: true + default_billing: true + }) { + id + customer_id + region { + region + region_id + region_code + } + country_code + street + company + telephone + fax + postcode + city + firstname + lastname + middlename + prefix + suffix + vat_id + default_shipping + default_billing + } + } + QUERY, + ['addressId' => 1, 'city' => 'New York'], + ['addressId' => 1, 'city' => 'Austin'], + ['email' => 'customer@example.com', 'password' => 'password'], + 'updateCustomerAddress', + 'city' + ], + 'Update Customer Email' => [ + <<<'QUERY' + mutation($email: String!, $password: String!) { + updateCustomerEmail( + email: $email + password: $password + ) { + customer { + email + } + } + } + QUERY, + ['email' => 'customer2@example.com', 'password' => 'password'], + ['email' => 'customer@example.com', 'password' => 'password'], + [ + ['email' => 'customer@example.com', 'password' => 'password'], + ['email' => 'customer2@example.com', 'password' => 'password'], + ], + 'updateCustomerEmail', + 'email', + ], + 'Generate Customer Token' => [ + <<<'QUERY' + mutation($email: String!, $password: String!) { + generateCustomerToken(email: $email, password: $password) { + token + } + } + QUERY, + ['email' => 'customer@example.com', 'password' => 'password'], + ['email' => 'customer@example.com', 'password' => 'password'], + [], + 'generateCustomerToken', + 'token' + ], + 'Get Customer' => [ + <<<'QUERY' + query { + customer { + created_at + date_of_birth + default_billing + default_shipping + date_of_birth + email + firstname + gender + id + is_subscribed + lastname + middlename + prefix + suffix + taxvat + } + } + QUERY, + [], + [], + ['email' => 'customer@example.com', 'password' => 'password'], + 'getCustomer', + '"data":{"customer":{"created_at"' + ], + ]; + } +} diff --git a/dev/tests/integration/testsuite/Magento/GraphQl/App/GraphQlStateTest.php b/dev/tests/integration/testsuite/Magento/GraphQl/App/GraphQlStateTest.php index 27e5a66634a87..91ec48060cde9 100644 --- a/dev/tests/integration/testsuite/Magento/GraphQl/App/GraphQlStateTest.php +++ b/dev/tests/integration/testsuite/Magento/GraphQl/App/GraphQlStateTest.php @@ -9,6 +9,7 @@ use Magento\Customer\Api\CustomerRepositoryInterface; use Magento\Framework\Registry; +use Magento\GraphQl\App\State\GraphQlStateDiff; use Magento\GraphQl\Quote\GetMaskedQuoteIdByReservedOrderId; /** @@ -24,14 +25,6 @@ */ class GraphQlStateTest extends \PHPUnit\Framework\TestCase { - - - /** @var CustomerRepositoryInterface */ - private CustomerRepositoryInterface $customerRepository; - - /** @var Registry */ - private $registry; - /** * @var GetMaskedQuoteIdByReservedOrderId */ @@ -59,58 +52,8 @@ protected function tearDown(): void parent::tearDown(); } - /** - * @magentoDataFixture Magento/Customer/_files/customer.php - * @magentoDataFixture Magento/Customer/_files/customer_address.php - * @dataProvider customerDataProvider - * @return void - * @throws \Exception - */ - public function testCustomerState( - string $query, - array $variables, - array $variables2, - array $authInfo, - string $operationName, - string $expected, - ) : void { - if ($operationName === 'createCustomer') { - $this->customerRepository = $this->graphQlStateDiff->getTestObjectManager() - ->get(CustomerRepositoryInterface::class); - $this->registry = $this->graphQlStateDiff->getTestObjectManager()->get(Registry::class); - $this->registry->register('isSecureArea', true); - try { - $customer = $this->customerRepository->get($variables['email']); - $this->customerRepository->delete($customer); - $customer2 = $this->customerRepository->get($variables2['email']); - $this->customerRepository->delete($customer2); - } catch (\Exception $e) { - // Customer does not exist - } finally { - $this->registry->unregister('isSecureArea', false); - } - } - $this->graphQlStateDiff-> - testState($query, $variables, $variables2, $authInfo, $operationName, $expected, $this); - } - /** * Runs various GraphQL queries and checks if state of shared objects in Object Manager have changed - * @magentoDataFixture Magento/Store/_files/store.php - * @magentoConfigFixture default_store catalog/seo/product_url_suffix test_product_suffix - * @magentoConfigFixture default_store catalog/seo/category_url_suffix test_category_suffix - * @magentoConfigFixture default_store catalog/seo/title_separator ___ - * @magentoConfigFixture default_store catalog/frontend/list_mode 2 - * @magentoConfigFixture default_store catalog/frontend/grid_per_page_values 16 - * @magentoConfigFixture default_store catalog/frontend/list_per_page_values 8 - * @magentoConfigFixture default_store catalog/frontend/grid_per_page 16 - * @magentoConfigFixture default_store catalog/frontend/list_per_page 8 - * @magentoConfigFixture default_store catalog/frontend/default_sort_by asc - * @magentoDataFixture Magento/GraphQl/Catalog/_files/simple_product.php - * @magentoDataFixture Magento/GraphQl/Quote/_files/guest/create_empty_cart.php - * @magentoDataFixture Magento/GraphQl/Quote/_files/add_simple_product.php - * @magentoDataFixture Magento/GraphQl/Quote/_files/set_new_shipping_address.php - * @magentoDataFixture Magento/GraphQl/Quote/_files/set_new_billing_address.php * @dataProvider queryDataProvider * @param string $query * @param array $variables @@ -129,32 +72,11 @@ public function testState( string $operationName, string $expected, ): void { - if (array_key_exists(1, $authInfo)) { - $authInfo1 = $authInfo[0]; - $authInfo2 = $authInfo[1]; - } else { - $authInfo1 = $authInfo; - $authInfo2 = $authInfo; - } if ($operationName == 'getCart') { $variables['id'] = $this->getMaskedQuoteIdByReservedOrderId->execute($variables['id']); } - $jsonEncodedRequest = json_encode([ - 'query' => $query, - 'variables' => $variables, - 'operationName' => $operationName - ]); - $output1 = $this->request($jsonEncodedRequest, $operationName, $authInfo1, true); - $this->assertStringContainsString($expected, $output1); - if ($variables2) { - $jsonEncodedRequest = json_encode([ - 'query' => $query, - 'variables' => $variables2, - 'operationName' => $operationName - ]); - } - $output2 = $this->request($jsonEncodedRequest, $operationName, $authInfo2); - $this->assertStringContainsString($expected, $output2); + $this->graphQlStateDiff-> + testState($query, $variables, $variables2, $authInfo, $operationName, $expected, $this); } /** @@ -588,202 +510,4 @@ public function queryDataProvider(): array ], ]; } - - /** - * Queries, variables, operation names, and expected responses for test - * - * @return array[] - * @SuppressWarnings(PHPMD.ExcessiveMethodLength) - */ - public function customerDataProvider(): array - { - return [ - 'Create Customer' => [ - <<<'QUERY' - mutation($firstname: String!, $lastname: String!, $email: String!, $password: String!) { - createCustomerV2( - input: { - firstname: $firstname, - lastname: $lastname, - email: $email, - password: $password - } - ) { - customer { - created_at - prefix - firstname - middlename - lastname - suffix - email - default_billing - default_shipping - date_of_birth - taxvat - is_subscribed - gender - allow_remote_shopping_assistance - } - } - } - QUERY, - [ - 'firstname' => 'John', - 'lastname' => 'Doe', - 'email' => 'email1@example.com', - 'password' => 'Password-1', - ], - [ - 'firstname' => 'John', - 'lastname' => 'Doe', - 'email' => 'email2@adobe.com', - 'password' => 'Password-2', - ], - [], - 'createCustomer', - '"email":"', - ], - 'Update Customer' => [ - <<<'QUERY' - mutation($allow: Boolean!) { - updateCustomerV2( - input: { - allow_remote_shopping_assistance: $allow - } - ) { - customer { - allow_remote_shopping_assistance - } - } - } - QUERY, - ['allow' => true], - ['allow' => false], - ['email' => 'customer@example.com', 'password' => 'password'], - 'updateCustomer', - 'allow_remote_shopping_assistance' - ], - 'Update Customer Address' => [ - <<<'QUERY' - mutation($addressId: Int!, $city: String!) { - updateCustomerAddress(id: $addressId, input: { - region: { - region: "Alberta" - region_id: 66 - region_code: "AB" - } - country_code: CA - street: ["Line 1 Street","Line 2"] - company: "Company Name" - telephone: "123456789" - fax: "123123123" - postcode: "7777" - city: $city - firstname: "Adam" - lastname: "Phillis" - middlename: "A" - prefix: "Mr." - suffix: "Jr." - vat_id: "1" - default_shipping: true - default_billing: true - }) { - id - customer_id - region { - region - region_id - region_code - } - country_code - street - company - telephone - fax - postcode - city - firstname - lastname - middlename - prefix - suffix - vat_id - default_shipping - default_billing - } - } - QUERY, - ['addressId' => 1, 'city' => 'New York'], - ['addressId' => 1, 'city' => 'Austin'], - ['email' => 'customer@example.com', 'password' => 'password'], - 'updateCustomerAddress', - 'city' - ], - 'Update Customer Email' => [ - <<<'QUERY' - mutation($email: String!, $password: String!) { - updateCustomerEmail( - email: $email - password: $password - ) { - customer { - email - } - } - } - QUERY, - ['email' => 'customer2@example.com', 'password' => 'password'], - ['email' => 'customer@example.com', 'password' => 'password'], - [ - ['email' => 'customer@example.com', 'password' => 'password'], - ['email' => 'customer2@example.com', 'password' => 'password'], - ], - 'updateCustomerEmail', - 'email', - ], - 'Generate Customer Token' => [ - <<<'QUERY' - mutation($email: String!, $password: String!) { - generateCustomerToken(email: $email, password: $password) { - token - } - } - QUERY, - ['email' => 'customer@example.com', 'password' => 'password'], - ['email' => 'customer@example.com', 'password' => 'password'], - [], - 'generateCustomerToken', - 'token' - ], - 'Get Customer' => [ - <<<'QUERY' - query { - customer { - created_at - date_of_birth - default_billing - default_shipping - date_of_birth - email - firstname - gender - id - is_subscribed - lastname - middlename - prefix - suffix - taxvat - } - } - QUERY, - [], - [], - ['email' => 'customer@example.com', 'password' => 'password'], - 'getCustomer', - '"data":{"customer":{"created_at"' - ], - ]; - } } diff --git a/dev/tests/integration/testsuite/Magento/GraphQl/App/GraphQlStateDiff.php b/dev/tests/integration/testsuite/Magento/GraphQl/App/State/GraphQlStateDiff.php similarity index 95% rename from dev/tests/integration/testsuite/Magento/GraphQl/App/GraphQlStateDiff.php rename to dev/tests/integration/testsuite/Magento/GraphQl/App/State/GraphQlStateDiff.php index 863b6dd1e3294..487a21da9b621 100644 --- a/dev/tests/integration/testsuite/Magento/GraphQl/App/GraphQlStateDiff.php +++ b/dev/tests/integration/testsuite/Magento/GraphQl/App/State/GraphQlStateDiff.php @@ -5,18 +5,13 @@ */ declare(strict_types=1); -namespace Magento\GraphQl\App; +namespace Magento\GraphQl\App\State; -use Magento\Customer\Api\CustomerRepositoryInterface; use Magento\Framework\App\Http as HttpApp; use Magento\Framework\App\ObjectManager as AppObjectManager; use Magento\Framework\App\Request\HttpFactory as RequestFactory; use Magento\Framework\App\Response\Http as HttpResponse; use Magento\Framework\ObjectManagerInterface; -use Magento\Framework\Registry; -use Magento\GraphQl\App\State\Comparator; -use Magento\GraphQl\App\State\ObjectManager; -use Magento\GraphQl\Quote\GetMaskedQuoteIdByReservedOrderId; use Magento\Integration\Api\CustomerTokenServiceInterface; use Magento\TestFramework\Helper\Bootstrap; use PHPUnit\Framework\TestCase; From a27ce94952a8ed74d5decf8fbdc660926c5a20eb Mon Sep 17 00:00:00 2001 From: Aakash Kumar Date: Sun, 24 Sep 2023 18:50:32 -0500 Subject: [PATCH 05/31] ACPT-1589: Add GraphQL P1 queries to GraphQlStateTest --- .../Magento/GraphQl/App/GraphQlStateTest.php | 58 ++++++++++++++++--- .../GraphQl/App/State/GraphQlStateDiff.php | 3 - .../GraphQl/_files/state-skip-list.php | 3 + 3 files changed, 53 insertions(+), 11 deletions(-) diff --git a/dev/tests/integration/testsuite/Magento/GraphQl/App/GraphQlStateTest.php b/dev/tests/integration/testsuite/Magento/GraphQl/App/GraphQlStateTest.php index 91ec48060cde9..0eeb62c2906b0 100644 --- a/dev/tests/integration/testsuite/Magento/GraphQl/App/GraphQlStateTest.php +++ b/dev/tests/integration/testsuite/Magento/GraphQl/App/GraphQlStateTest.php @@ -7,8 +7,6 @@ namespace Magento\GraphQl\App; -use Magento\Customer\Api\CustomerRepositoryInterface; -use Magento\Framework\Registry; use Magento\GraphQl\App\State\GraphQlStateDiff; use Magento\GraphQl\Quote\GetMaskedQuoteIdByReservedOrderId; @@ -19,9 +17,6 @@ * @magentoDbIsolation disabled * @magentoAppIsolation enabled * @magentoAppArea graphql - * @magentoDataFixture Magento/Catalog/_files/multiple_mixed_products.php - * @magentoDataFixture Magento/Catalog/_files/categories.php - * */ class GraphQlStateTest extends \PHPUnit\Framework\TestCase { @@ -38,8 +33,6 @@ class GraphQlStateTest extends \PHPUnit\Framework\TestCase protected function setUp(): void { $this->graphQlStateDiff = new GraphQlStateDiff(); -// $this->getMaskedQuoteIdByReservedOrderId = -// $this->graphQlStateDiff->getTestObjectManager()->get(GetMaskedQuoteIdByReservedOrderId::class); parent::setUp(); } @@ -61,6 +54,9 @@ protected function tearDown(): void * @param array $authInfo * @param string $operationName * @param string $expected + * @magentoDataFixture Magento/Store/_files/store.php + * @magentoDataFixture Magento/Catalog/_files/multiple_mixed_products.php + * @magentoDataFixture Magento/Catalog/_files/categories.php * @return void * @throws \Exception */ @@ -72,7 +68,47 @@ public function testState( string $operationName, string $expected, ): void { + $this->graphQlStateDiff-> + testState($query, $variables, $variables2, $authInfo, $operationName, $expected, $this); + } + + + /** + * @magentoConfigFixture default_store catalog/seo/product_url_suffix test_product_suffix + * @magentoConfigFixture default_store catalog/seo/category_url_suffix test_category_suffix + * @magentoConfigFixture default_store catalog/seo/title_separator ___ + * @magentoConfigFixture default_store catalog/frontend/list_mode 2 + * @magentoConfigFixture default_store catalog/frontend/grid_per_page_values 16 + * @magentoConfigFixture default_store catalog/frontend/list_per_page_values 8 + * @magentoConfigFixture default_store catalog/frontend/grid_per_page 16 + * @magentoConfigFixture default_store catalog/frontend/list_per_page 8 + * @magentoConfigFixture default_store catalog/frontend/default_sort_by asc + * @magentoDataFixture Magento/GraphQl/Catalog/_files/simple_product.php + * @magentoDataFixture Magento/GraphQl/Quote/_files/guest/create_empty_cart.php + * @magentoDataFixture Magento/GraphQl/Quote/_files/add_simple_product.php + * @magentoDataFixture Magento/GraphQl/Quote/_files/set_new_shipping_address.php + * @magentoDataFixture Magento/GraphQl/Quote/_files/set_new_billing_address.php + * @dataProvider cartQueryProvider + * @param string $query + * @param array $variables + * @param array $variables2 + * @param array $authInfo + * @param string $operationName + * @param string $expected + * @return void + */ + public function testCartState( + string $query, + array $variables, + array $variables2, + array $authInfo, + string $operationName, + string $expected + ): void + { if ($operationName == 'getCart') { + $this->getMaskedQuoteIdByReservedOrderId = + $this->graphQlStateDiff->getTestObjectManager()->get(GetMaskedQuoteIdByReservedOrderId::class); $variables['id'] = $this->getMaskedQuoteIdByReservedOrderId->execute($variables['id']); } $this->graphQlStateDiff-> @@ -366,7 +402,7 @@ public function queryDataProvider(): array [], [], 'storeConfig', - '"storeConfig":{"product_url_suffix":"test_product_suffix"' + '"storeConfig":{"product_url_suffix":".html"' ], 'Get Categories by name' => [ <<<'QUERY' @@ -461,6 +497,12 @@ public function queryDataProvider(): array 'products', '"data":{"products":{"items":[{' ], + ]; + } + + public function cartQueryProvider(): array + { + return [ 'Get Cart' => [ <<<'QUERY' query cart($id: String!) { diff --git a/dev/tests/integration/testsuite/Magento/GraphQl/App/State/GraphQlStateDiff.php b/dev/tests/integration/testsuite/Magento/GraphQl/App/State/GraphQlStateDiff.php index 487a21da9b621..3c36455a79914 100644 --- a/dev/tests/integration/testsuite/Magento/GraphQl/App/State/GraphQlStateDiff.php +++ b/dev/tests/integration/testsuite/Magento/GraphQl/App/State/GraphQlStateDiff.php @@ -78,9 +78,6 @@ public function testState( $authInfo1 = $authInfo; $authInfo2 = $authInfo; } - if ($operationName == 'getCart') { - $variables['id'] = $this->getMaskedQuoteIdByReservedOrderId->execute($variables['id']); - } $jsonEncodedRequest = json_encode([ 'query' => $query, 'variables' => $variables, diff --git a/dev/tests/integration/testsuite/Magento/GraphQl/_files/state-skip-list.php b/dev/tests/integration/testsuite/Magento/GraphQl/_files/state-skip-list.php index 0a699696f95b0..02c0def519758 100644 --- a/dev/tests/integration/testsuite/Magento/GraphQl/_files/state-skip-list.php +++ b/dev/tests/integration/testsuite/Magento/GraphQl/_files/state-skip-list.php @@ -726,6 +726,9 @@ null, // TODO: confirm this gets reset from poison pill or is otherwise okay. Magento\Ui\Config\Converter::class => null, // TODO: confirm this is cleaned when poison pill triggered + Magento\SalesRule\Model\ResourceModel\Rule::class => null, + Magento\SalesRule\Model\Plugin\QuoteConfigProductAttributes::class => null, + Magento\QuoteGraphQl\Plugin\ProductAttributesExtender::class => null, ], '' => [ ], From f19dfe16f41c3f759a9172ad599242da712da8ce Mon Sep 17 00:00:00 2001 From: Aakash Kumar Date: Wed, 27 Sep 2023 11:52:42 -0500 Subject: [PATCH 06/31] ACPT-1617: Add checkout mutations to GraphQlStateTest --- .../App/GraphQlCheckoutMutationsStateTest.php | 720 ++++++++++++++++++ .../Magento/GraphQl/App/GraphQlStateTest.php | 4 +- .../GraphQl/App/State/GraphQlStateDiff.php | 19 + 3 files changed, 741 insertions(+), 2 deletions(-) create mode 100644 dev/tests/integration/testsuite/Magento/GraphQl/App/GraphQlCheckoutMutationsStateTest.php diff --git a/dev/tests/integration/testsuite/Magento/GraphQl/App/GraphQlCheckoutMutationsStateTest.php b/dev/tests/integration/testsuite/Magento/GraphQl/App/GraphQlCheckoutMutationsStateTest.php new file mode 100644 index 0000000000000..659cabaaf93cb --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/GraphQl/App/GraphQlCheckoutMutationsStateTest.php @@ -0,0 +1,720 @@ +graphQlStateDiff = new GraphQlStateDiff(); + parent::setUp(); + } + + /** + * @inheritDoc + */ + protected function tearDown(): void + { + $this->graphQlStateDiff->tearDown(); + parent::tearDown(); + } + + private function getCartIdHash(): string + { + $getMaskedQuoteIdByReservedOrderId = $this->graphQlStateDiff-> + getTestObjectManager()->get(GetMaskedQuoteIdByReservedOrderId::class); + return $getMaskedQuoteIdByReservedOrderId->execute('test_quote'); + } + + /** + * @return void + * @throws \Exception + */ + public function testCreateEmptyCart() : void + { + $this->graphQlStateDiff-> + testState($this->getEmptyCart(), + [], + [], + [], + 'createEmptyCart', + '"data":{"createEmptyCart":', + $this + ); + } + + + /** + * @magentoDataFixture Magento/GraphQl/Quote/_files/guest/create_empty_cart.php + * @magentoDataFixture Magento/GraphQl/Catalog/_files/simple_product.php + * @return void + * @throws \Exception + */ + public function testAddSimpleProductToCart() + { + $cartId = $this->getCartIdHash(); + $query = $this->getAddProductToCartQuery(); + $this->graphQlStateDiff->testState( + $query, + ['cartId' => $cartId, 'qty' => 1, 'sku' => 'simple_product'], + [], + [], + 'addSimpleProductsToCart', + '"data":{"addSimpleProductsToCart":', + $this + ); + } + /** + * @magentoDataFixture Magento/GraphQl/Quote/_files/guest/create_empty_cart.php + * @magentoDataFixture Magento/GraphQl/Catalog/_files/virtual_product.php + * @return void + * @throws \Exception + */ + public function testAddVirtualProductToCart() + { + $cartId = $this->getCartIdHash(); + $query = $this->getAddVirtualProductToCartQuery(); + $this->graphQlStateDiff->testState( + $query, + ['cartId' => $cartId, 'quantity' => 1, 'sku' => 'virtual_product'], + [], + [], + 'addSimpleProductsToCart', + '"data":{"addVirtualProductsToCart":', + $this + ); + } + + /** + * @magentoDataFixture Magento/GraphQl/Quote/_files/guest/create_empty_cart.php + * @magentoDataFixture Magento/Bundle/_files/product.php + * @return void + */ + public function testAddBundleProductToCart() + { + $cartId = $this->getCartIdHash(); + $query = $this->getAddBundleProductToCartQuery($cartId, 'bundle-product'); + $this->graphQlStateDiff->testState( + $query, + [], + [], + [], + 'addBundleProductsToCart', + '"data":{"addBundleProductsToCart":', + $this + ); + } + + /** + * @magentoDataFixture Magento/GraphQl/Quote/_files/guest/create_empty_cart.php + * @magentoDataFixture Magento/ConfigurableProduct/_files/product_configurable.php + * @return void + */ + public function testAddConfigurableProductToCart(): void + { + $cartId = $this->getCartIdHash(); + $query = $this->getAddConfigurableProductToCartQuery(); + $this->graphQlStateDiff->testState( + $query, + ['cartId' => $cartId, 'quantity' => 2, 'parentSku' => 'configurable', 'childSku' => 'simple_20'], + [], + [], + 'addConfigurableProductsToCart', + '"data":{"addConfigurableProductsToCart":', + $this + ); + } + + /** + * @magentoDataFixture Magento/GraphQl/Quote/_files/guest/create_empty_cart.php + * @magentoDataFixture Magento/Downloadable/_files/product_downloadable_with_purchased_separately_links.php + * @return void + */ + public function testAddDownloadableProductToCart(): void + { + $cartId = $this->getCartIdHash(); + $sku = 'downloadable-product-with-purchased-separately-links'; + $links = $this->getProductsLinks($sku); + $linkId = key($links); + $query = $this->getAddDownloadableProductToCartQuery(); + $this->graphQlStateDiff->testState( + $query, + ['cartId' => $cartId, 'qty' => 1, 'sku' => $sku, 'linkId' => $linkId], + [], + [], + 'addDownloadableProductsToCart', + '"data":{"addDownloadableProductsToCart":', + $this + ); + } + + /** + * @magentoDataFixture Magento/GraphQl/Catalog/_files/simple_product.php + * @magentoDataFixture Magento/GraphQl/Quote/_files/guest/create_empty_cart.php + * @magentoDataFixture Magento/GraphQl/Quote/_files/add_simple_product.php + * @return void + */ + public function testSetShippingAddressOnCart(): void + { + $cartId = $this->getCartIdHash(); + $query = $this->getShippingAddressQuery(); + $this->graphQlStateDiff->testState( + $query, + ['cartId' => $cartId], + [], + [], + 'setShippingAddressesOnCart', + '"data":{"setShippingAddressesOnCart":', + $this + ); + } + + /** + * @magentoDataFixture Magento/GraphQl/Catalog/_files/simple_product.php + * @magentoDataFixture Magento/GraphQl/Quote/_files/guest/create_empty_cart.php + * @magentoDataFixture Magento/GraphQl/Quote/_files/add_simple_product.php + * @magentoDataFixture Magento/GraphQl/Quote/_files/set_new_shipping_address.php + * @return void + */ + public function testSetBillingAddressOnCart(): void + { + $cartId = $this->getCartIdHash(); + $query = $this->getBillingAddressQuery(); + $this->graphQlStateDiff->testState( + $query, + ['cartId' => $cartId], + [], + [], + 'setBillingAddressOnCart', + '"data":{"setBillingAddressOnCart":', + $this + ); + } + + /** + * @magentoDataFixture Magento/GraphQl/Catalog/_files/simple_product.php + * @magentoDataFixture Magento/GraphQl/Quote/_files/guest/create_empty_cart.php + * @magentoDataFixture Magento/GraphQl/Quote/_files/add_simple_product.php + * @magentoDataFixture Magento/GraphQl/Quote/_files/set_new_shipping_address.php + * @magentoDataFixture Magento/GraphQl/Quote/_files/set_new_billing_address.php + * @return void + */ + public function testSetShippingMethodsOnCart(): void + { + $cartId = $this->getCartIdHash(); + $query = $this->getShippingMethodsQuery(); + $this->graphQlStateDiff->testState( + $query, + ['cartId' => $cartId, 'shippingMethod' => 'flatrate'], + [], + [], + 'setShippingMethodsOnCart', + '"data":{"setShippingMethodsOnCart":', + $this + ); + } + + /** + * @magentoDataFixture Magento/GraphQl/Catalog/_files/simple_product.php + * @magentoDataFixture Magento/GraphQl/Quote/_files/guest/create_empty_cart.php + * @magentoDataFixture Magento/GraphQl/Quote/_files/add_simple_product.php + * @magentoDataFixture Magento/GraphQl/Quote/_files/set_new_shipping_address.php + * @magentoDataFixture Magento/GraphQl/Quote/_files/set_new_billing_address.php + * @magentoDataFixture Magento/GraphQl/Quote/_files/set_flatrate_shipping_method.php + */ + public function testSetPaymentMethodOnCart(): void + { + $cartId = $this->getCartIdHash(); + $query = $this->getPaymentMethodQuery(); + $this->graphQlStateDiff->testState( + $query, + ['cartId' => $cartId], + [], + [], + 'setPaymentMethodOnCart', + '"data":{"setPaymentMethodOnCart":', + $this + ); + + } + + /** + * @magentoDataFixture Magento/GraphQl/Catalog/_files/simple_product.php + * @magentoDataFixture Magento/GraphQl/Quote/_files/guest/create_empty_cart.php + * @magentoDataFixture Magento/GraphQl/Quote/_files/add_simple_product.php + * @magentoDataFixture Magento/GraphQl/Quote/_files/set_new_shipping_address.php + * @magentoDataFixture Magento/GraphQl/Quote/_files/set_new_billing_address.php + * @magentoDataFixture Magento/GraphQl/Quote/_files/set_flatrate_shipping_method.php + * @magentoDataFixture Magento/GraphQl/Quote/_files/set_checkmo_payment_method.php + * @magentoDataFixture Magento/GraphQl/Quote/_files/guest/set_guest_email.php + */ + public function testPlaceOrder(): void + { + $cartId = $this->getCartIdHash(); + $query = $this->getPlaceOrderQuery(); + $this->graphQlStateDiff->testState( + $query, + ['cartId' => $cartId], + [], + [], + 'placeOrder', + '"data":{"placeOrder":', + $this + ); + + } + + private function getBillingAddressQuery(): string + { + return <<<'QUERY' + mutation($cartId: String!) { + setBillingAddressOnCart( + input: { + cart_id: $cartId + billing_address: { + address: { + firstname: "John" + lastname: "Doe" + street: ["123 Main Street"] + city: "New York" + region: "NY" + postcode: "10001" + country_code: "US" + telephone: "555-555-5555" + } + } + } + ) { + cart { + id + billing_address { + firstname + lastname + street + city + region { + code + label + } + postcode + country { + code + label + } + telephone + } + } + } + } + QUERY; + } + + private function getShippingAddressQuery(): string + { + return <<<'QUERY' + mutation($cartId: String!) { + setShippingAddressesOnCart( + input: { + cart_id: $cartId + shipping_addresses: [ + { + address: { + firstname: "John" + lastname: "Doe" + street: ["123 Main Street"] + city: "New York" + region: "NY" + postcode: "10001" + country_code: "US" + telephone: "555-555-5555" + } + } + ] + } + ) { + cart { + id + shipping_addresses { + firstname + lastname + street + city + region { + code + label + } + postcode + country { + code + label + } + telephone + available_shipping_methods { + carrier_code + method_code + amount { + value + } + } + } + } + } + } + QUERY; + } + /** + * Function returns array of all product's links + * + * @param string $sku + * @return array + */ + private function getProductsLinks(string $sku) : array + { + $result = []; + $productRepository = $this->graphQlStateDiff->getTestObjectManager() + ->get(ProductRepositoryInterface::class); + $product = $productRepository->get($sku, false, null, true); + + foreach ($product->getDownloadableLinks() as $linkObject) { + $result[$linkObject->getLinkId()] = [ + 'title' => $linkObject->getTitle(), + 'link_type' => null, //deprecated field + 'price' => $linkObject->getPrice(), + ]; + } + return $result; + } + + private function getAddDownloadableProductToCartQuery(): string + { + return <<<'MUTATION' + mutation($cartId: String!, $qty: Float!, $sku: String!, $linkId: Int!) { + addDownloadableProductsToCart( + input: { + cart_id: $cartId, + cart_items: [ + { + data: { + quantity: $qty, + sku: $sku + }, + downloadable_product_links: [ + { + link_id: $linkId + } + ] + } + ] + } + ) { + cart { + items { + quantity + ... on DownloadableCartItem { + links { + title + link_type + price + } + samples { + id + title + } + } + } + } + } + } + MUTATION; + } + + private function getAddConfigurableProductToCartQuery(): string + { + return <<<'QUERY' + mutation($cartId: String!, $quantity: Float!, $parentSku: String!, $childSku: String!) { + addConfigurableProductsToCart( + input:{ + cart_id: $cartId + cart_items:{ + parent_sku: $parentSku + data:{ + sku: $childSku + quantity:$quantity + } + } + } + ) { + cart { + id + items { + id + quantity + product { + sku + } + ... on ConfigurableCartItem { + configurable_options { + id + option_label + value_id + value_label + } + } + } + } + } + } + QUERY; + } + + private function getAddBundleProductToCartQuery(string $cartId, string $sku) + { + $productRepository = $this->graphQlStateDiff->getTestObjectManager()->get(ProductRepositoryInterface::class); + $product = $productRepository->get($sku); + /** @var $typeInstance \Magento\Bundle\Model\Product\Type */ + $typeInstance = $product->getTypeInstance(); + $typeInstance->setStoreFilter($product->getStoreId(), $product); + /** @var $option \Magento\Bundle\Model\Option */ + $option = $typeInstance->getOptionsCollection($product)->getFirstItem(); + /** @var \Magento\Catalog\Model\Product $selection */ + $selection = $typeInstance->getSelectionsCollection([$option->getId()], $product)->getFirstItem(); + $optionId = $option->getId(); + $selectionId = $selection->getSelectionId(); + + return <<getMaskedQuoteIdByReservedOrderId->execute($variables['id']); } $this->graphQlStateDiff-> - testState($query, $variables, $variables2, $authInfo, $operationName, $expected, $this); + testState($query, $variables, $variables2, $authInfo, $operationName, $expected, $this); } /** @@ -121,7 +121,7 @@ public function testCartState( * @return array[] * @SuppressWarnings(PHPMD.ExcessiveMethodLength) */ - public function queryDataProvider(): array + private function queryDataProvider(): array { return [ 'Get Navigation Menu by category_id' => [ diff --git a/dev/tests/integration/testsuite/Magento/GraphQl/App/State/GraphQlStateDiff.php b/dev/tests/integration/testsuite/Magento/GraphQl/App/State/GraphQlStateDiff.php index 3c36455a79914..f6e1245399f63 100644 --- a/dev/tests/integration/testsuite/Magento/GraphQl/App/State/GraphQlStateDiff.php +++ b/dev/tests/integration/testsuite/Magento/GraphQl/App/State/GraphQlStateDiff.php @@ -13,6 +13,7 @@ use Magento\Framework\App\Response\Http as HttpResponse; use Magento\Framework\ObjectManagerInterface; use Magento\Integration\Api\CustomerTokenServiceInterface; +use Magento\Quote\Model\MaskedQuoteIdToQuoteIdInterface; use Magento\TestFramework\Helper\Bootstrap; use PHPUnit\Framework\TestCase; @@ -85,6 +86,9 @@ public function testState( ]); $output1 = $this->request($jsonEncodedRequest, $operationName, $authInfo1, $test,true); $test->assertStringContainsString($expected, $output1); + if ($operationName === 'placeOrder') { + $this->reactivateCart($variables); + } if ($variables2) { $jsonEncodedRequest = json_encode([ 'query' => $query, @@ -160,4 +164,19 @@ private function doRequest(string $query, array $authInfo) $actualResponse = $httpApp->launch(); return $actualResponse->getContent(); } + + /** + * @param array $variables + * @return void + */ + private function reactivateCart(array $variables) + { + $maskedQuoteIdToQuoteId = + $this->objectManagerForTest->get(MaskedQuoteIdToQuoteIdInterface::class); + $cart = $this->objectManagerForTest->get(\Magento\Quote\Model\Quote::class); + $cartId = $maskedQuoteIdToQuoteId->execute($variables['cartId']); + $cart->load($cartId); + $cart->setIsActive(true); + $cart->save(); + } } From 0f8c09eee4e5abfd5d04a4612c2b605a5cd47b86 Mon Sep 17 00:00:00 2001 From: Aakash Kumar Date: Tue, 3 Oct 2023 18:06:08 -0500 Subject: [PATCH 07/31] ACPT-1617: Add checkout mutations to GraphQlStateTest; -update skiplist --- .../GraphQl/_files/state-skip-list.php | 436 ++++++++++++++++++ 1 file changed, 436 insertions(+) diff --git a/dev/tests/integration/testsuite/Magento/GraphQl/_files/state-skip-list.php b/dev/tests/integration/testsuite/Magento/GraphQl/_files/state-skip-list.php index 02c0def519758..a6c098cd3ad06 100644 --- a/dev/tests/integration/testsuite/Magento/GraphQl/_files/state-skip-list.php +++ b/dev/tests/integration/testsuite/Magento/GraphQl/_files/state-skip-list.php @@ -37,6 +37,318 @@ 'resolveUrl' => [ Magento\Framework\GraphQl\Query\Fields::class => null, ], + 'addSimpleProductsToCart' => [ + Magento\Framework\Stdlib\ArrayManager::class => null, + Magento\Config\Model\Config\Processor\EnvironmentPlaceholder::class => null, + Magento\Quote\Model\ResourceModel\Quote::class => null, + Magento\Quote\Model\QuoteIdToMaskedQuoteId::class => null, + Magento\GraphQl\Quote\GetMaskedQuoteIdByReservedOrderId::class => null, + Magento\Framework\Reflection\MethodsMap::class => null, + Magento\Framework\Reflection\DataObjectProcessor::class => null, + Magento\Catalog\Model\ResourceModel\Product::class => null, + Magento\Framework\Api\DataObjectHelper::class => null, + Magento\Catalog\Model\ProductRepository::class => null, + Magento\CatalogInventory\Model\StockRegistryProvider::class => null, + Magento\CatalogInventory\Model\StockRegistry::class => null, + Magento\Framework\Translate\Inline::class => null, + Magento\Framework\Json\Encoder::class => null, + Magento\Customer\Model\ResourceModel\Customer::class => null, + Magento\Customer\Model\ResourceModel\CustomerRepository::class => null, + Laminas\Uri\Uri::class => null, + Magento\Customer\Model\Session\Validators\CutoffValidator::class => null, + Magento\Customer\Model\Customer::class => null, + Magento\Customer\Model\Session\SessionCleaner::class => null, + Magento\Tax\Model\Calculation::class => null, + Magento\Tax\Model\TaxCalculation::class => null, + Magento\SalesRule\Model\RulesApplier::class => null, + Magento\OfflineShipping\Model\SalesRule\Calculator::class => null, + Magento\OfflineShipping\Model\Quote\Address\FreeShipping::class => null, + Magento\SalesRule\Model\Validator::class => null, + Magento\Quote\Model\Quote\Address\Total\Collector::class => null, + Magento\Quote\Model\Quote\TotalsCollectorList::class => null, + Magento\Quote\Model\Quote\TotalsCollector::class => null, + Magento\User\Helper\Data::class => null, + Magento\Authorization\Model\RoleFactory::class => null, + Magento\User\Model\UserValidationRules::class => null, + Magento\Framework\Acl\Data\Cache::class => null, + Magento\User\Model\Backend\Config\ObserverConfig::class => null, + Magento\User\Model\ResourceModel\User::class => null, + Magento\User\Model\Notificator::class => null, + Magento\TestModuleCatalogInventoryCache\Plugin\PreventCachingPreloadedStockDataInToStockRegistry::class => null, + Magento\Quote\Model\Quote\ProductOptionFactory::class => null, + Magento\Quote\Api\Data\ProductOptionExtensionFactory::class => null, + Magento\Catalog\Model\CustomOptions\CustomOptionProcessor::class => null, + ], + 'addBundleProductsToCart' => [ + Magento\Framework\Stdlib\ArrayManager::class => null, + Magento\Config\Model\Config\Processor\EnvironmentPlaceholder::class => null, + Magento\Quote\Model\ResourceModel\Quote::class => null, + Magento\Quote\Model\QuoteIdToMaskedQuoteId::class => null, + Magento\GraphQl\Quote\GetMaskedQuoteIdByReservedOrderId::class => null, + Magento\Framework\Reflection\MethodsMap::class => null, + Magento\Framework\Reflection\DataObjectProcessor::class => null, + Magento\Framework\Api\DataObjectHelper::class => null, + Magento\Framework\Translate\Inline::class => null, + Magento\Framework\Json\Encoder::class => null, + Magento\Customer\Model\ResourceModel\Customer::class => null, + Magento\Customer\Model\ResourceModel\CustomerRepository::class => null, + Laminas\Uri\Uri::class => null, + Magento\Customer\Model\Session\Validators\CutoffValidator::class => null, + Magento\Customer\Model\Customer::class => null, + Magento\Customer\Model\Session\SessionCleaner::class => null, + Magento\Tax\Model\Calculation::class => null, + Magento\Tax\Model\TaxCalculation::class => null, + Magento\SalesRule\Model\RulesApplier::class => null, + Magento\OfflineShipping\Model\SalesRule\Calculator::class => null, + Magento\OfflineShipping\Model\Quote\Address\FreeShipping::class => null, + Magento\SalesRule\Model\Validator::class => null, + Magento\Quote\Model\Quote\Address\Total\Collector::class => null, + Magento\Quote\Model\Quote\TotalsCollectorList::class => null, + Magento\Quote\Model\Quote\TotalsCollector::class => null, + Magento\Downloadable\Model\Url\DomainValidator::class => null, + Magento\User\Helper\Data::class => null, + Magento\Authorization\Model\RoleFactory::class => null, + Magento\User\Model\UserValidationRules::class => null, + Magento\Framework\Acl\Data\Cache::class => null, + Magento\User\Model\Backend\Config\ObserverConfig::class => null, + Magento\User\Model\ResourceModel\User::class => null, + Magento\User\Model\Notificator::class => null, + Magento\TestModuleCatalogInventoryCache\Plugin\PreventCachingPreloadedStockDataInToStockRegistry::class => null, + Magento\Quote\Api\Data\ProductOptionExtensionFactory::class => null, + Magento\Quote\Api\Data\ProductOptionInterfaceFactory::class => null, + Magento\Bundle\Model\CartItemProcessor::class => null, + Magento\Quote\Model\Quote\ProductOptionFactory::class => null, + Magento\Catalog\Model\CustomOptions\CustomOptionProcessor::class => null, + ], + 'addConfigurableProductsToCart' => [ + Magento\Framework\Stdlib\ArrayManager::class => null, + Magento\Config\Model\Config\Processor\EnvironmentPlaceholder::class => null, + Magento\Quote\Model\ResourceModel\Quote::class => null, + Magento\Quote\Model\QuoteIdToMaskedQuoteId::class => null, + Magento\GraphQl\Quote\GetMaskedQuoteIdByReservedOrderId::class => null, + Magento\Framework\Reflection\MethodsMap::class => null, + Magento\Framework\Reflection\DataObjectProcessor::class => null, + Magento\Catalog\Model\ResourceModel\Product::class => null, + Magento\Framework\Api\DataObjectHelper::class => null, + Magento\Catalog\Model\ProductRepository::class => null, + Magento\CatalogInventory\Model\StockRegistryProvider::class => null, + Magento\CatalogInventory\Model\StockRegistry::class => null, + Magento\Framework\Translate\Inline::class => null, + Magento\Framework\Json\Encoder::class => null, + Magento\Customer\Model\ResourceModel\Customer::class => null, + Magento\Customer\Model\ResourceModel\CustomerRepository::class => null, + Laminas\Uri\Uri::class => null, + Magento\Customer\Model\Session\Validators\CutoffValidator::class => null, + Magento\Customer\Model\Customer::class => null, + Magento\Customer\Model\Session\SessionCleaner::class => null, + Magento\Tax\Model\Calculation::class => null, + Magento\Tax\Model\TaxCalculation::class => null, + Magento\SalesRule\Model\RulesApplier::class => null, + Magento\OfflineShipping\Model\SalesRule\Calculator::class => null, + Magento\OfflineShipping\Model\Quote\Address\FreeShipping::class => null, + Magento\SalesRule\Model\Validator::class => null, + Magento\Quote\Model\Quote\Address\Total\Collector::class => null, + Magento\Quote\Model\Quote\TotalsCollectorList::class => null, + Magento\Quote\Model\Quote\TotalsCollector::class => null, + Magento\User\Helper\Data::class => null, + Magento\Authorization\Model\RoleFactory::class => null, + Magento\User\Model\UserValidationRules::class => null, + Magento\Framework\Acl\Data\Cache::class => null, + Magento\User\Model\Backend\Config\ObserverConfig::class => null, + Magento\User\Model\ResourceModel\User::class => null, + Magento\User\Model\Notificator::class => null, + Magento\TestModuleCatalogInventoryCache\Plugin\PreventCachingPreloadedStockDataInToStockRegistry::class => null, + Magento\Eav\Plugin\Model\ResourceModel\Entity\Attribute::class => null, + Magento\Quote\Model\Quote\ProductOptionFactory::class => null, + Magento\Quote\Api\Data\ProductOptionExtensionFactory::class => null, + Magento\ConfigurableProduct\Model\Quote\Item\CartItemProcessor::class => null, + Magento\Catalog\Model\CustomOptions\CustomOptionProcessor::class => null, + ], + 'addDownloadableProductsToCart' => [ + Magento\Framework\Stdlib\ArrayManager::class => null, + Magento\Config\Model\Config\Processor\EnvironmentPlaceholder::class => null, + Magento\Quote\Model\ResourceModel\Quote::class => null, + Magento\Quote\Model\QuoteIdToMaskedQuoteId::class => null, + Magento\GraphQl\Quote\GetMaskedQuoteIdByReservedOrderId::class => null, + Magento\Framework\Reflection\MethodsMap::class => null, + Magento\Framework\Reflection\DataObjectProcessor::class => null, + Magento\Framework\Api\DataObjectHelper::class => null, + Magento\Framework\Translate\Inline::class => null, + Magento\Framework\Json\Encoder::class => null, + Magento\Customer\Model\ResourceModel\Customer::class => null, + Magento\Customer\Model\ResourceModel\CustomerRepository::class => null, + Laminas\Uri\Uri::class => null, + Magento\Customer\Model\Session\Validators\CutoffValidator::class => null, + Magento\Customer\Model\Customer::class => null, + Magento\Customer\Model\Session\SessionCleaner::class => null, + Magento\Tax\Model\Calculation::class => null, + Magento\Tax\Model\TaxCalculation::class => null, + Magento\SalesRule\Model\RulesApplier::class => null, + Magento\OfflineShipping\Model\SalesRule\Calculator::class => null, + Magento\OfflineShipping\Model\Quote\Address\FreeShipping::class => null, + Magento\SalesRule\Model\Validator::class => null, + Magento\Quote\Model\Quote\Address\Total\Collector::class => null, + Magento\Quote\Model\Quote\TotalsCollectorList::class => null, + Magento\Quote\Model\Quote\TotalsCollector::class => null, + Magento\Downloadable\Model\Url\DomainValidator::class => null, + Magento\Framework\Url\QueryParamsResolver::class => null, + Magento\User\Helper\Data::class => null, + Magento\Authorization\Model\RoleFactory::class => null, + Magento\User\Model\UserValidationRules::class => null, + Magento\Framework\Acl\Data\Cache::class => null, + Magento\User\Model\Backend\Config\ObserverConfig::class => null, + Magento\User\Model\ResourceModel\User::class => null, + Magento\User\Model\Notificator::class => null, + Magento\TestModuleCatalogInventoryCache\Plugin\PreventCachingPreloadedStockDataInToStockRegistry::class => null, + Magento\Quote\Model\Quote\ProductOptionFactory::class => null, + Magento\Quote\Api\Data\ProductOptionExtensionFactory::class => null, + Magento\Downloadable\Model\Quote\Item\CartItemProcessor::class => null, + Magento\Catalog\Model\CustomOptions\CustomOptionProcessor::class => null, + ], + 'setShippingAddressesOnCart' => [ + setShippingAddressesOnCart::class => null, + Magento\Framework\Reflection\DataObjectProcessor::class => null, + Magento\Framework\Api\DataObjectHelper::class => null, + Magento\Framework\Translate\Inline::class => null, + Magento\Framework\Json\Encoder::class => null, + Magento\Directory\Helper\Data::class => null, + Magento\Customer\Model\ResourceModel\AddressRepository::class => null, + Magento\Customer\Model\ResourceModel\Customer::class => null, + Magento\Customer\Model\ResourceModel\CustomerRepository::class => null, + Laminas\Uri\Uri::class => null, + Magento\Customer\Model\Session\Validators\CutoffValidator::class => null, + Magento\Customer\Model\Customer::class => null, + Magento\Customer\Model\Session\SessionCleaner::class => null, + Magento\Tax\Model\Calculation::class => null, + Magento\Tax\Model\TaxCalculation::class => null, + Magento\SalesRule\Model\RulesApplier::class => null, + Magento\OfflineShipping\Model\SalesRule\Calculator::class => null, + Magento\OfflineShipping\Model\Quote\Address\FreeShipping::class => null, + Magento\SalesRule\Model\Validator::class => null, + Magento\Quote\Model\Quote\Address\Total\Collector::class => null, + Magento\Quote\Model\Quote\TotalsCollectorList::class => null, + Magento\Quote\Model\Quote\TotalsCollector::class => null, + Magento\Framework\Reflection\MethodsMap::class => null, + ], + 'setBillingAddressOnCart' => [ + Magento\Framework\Reflection\MethodsMap::class => null, + Magento\Framework\Reflection\DataObjectProcessor::class => null, + Magento\Framework\Api\DataObjectHelper::class => null, + Magento\Framework\Translate\Inline::class => null, + Magento\Framework\Json\Encoder::class => null, + Magento\Directory\Helper\Data::class => null, + Magento\Customer\Model\ResourceModel\AddressRepository::class => null, + Magento\Customer\Model\ResourceModel\Customer::class => null, + Magento\Customer\Model\ResourceModel\CustomerRepository::class => null, + Laminas\Uri\Uri::class => null, + Magento\Customer\Model\Session\Validators\CutoffValidator::class => null, + Magento\Customer\Model\Customer::class => null, + Magento\Customer\Model\Session\SessionCleaner::class => null, + Magento\Tax\Model\Calculation::class => null, + Magento\Tax\Model\TaxCalculation::class => null, + Magento\SalesRule\Model\RulesApplier::class => null, + Magento\OfflineShipping\Model\SalesRule\Calculator::class => null, + Magento\OfflineShipping\Model\Quote\Address\FreeShipping::class => null, + Magento\SalesRule\Model\Validator::class => null, + Magento\Quote\Model\Quote\Address\Total\Collector::class => null, + Magento\Quote\Model\Quote\TotalsCollectorList::class => null, + Magento\Quote\Model\Quote\TotalsCollector::class => null + ], + 'setShippingMethodsOnCart' => [ + Magento\Quote\Model\ResourceModel\Quote::class => null, + Magento\Quote\Model\QuoteIdToMaskedQuoteId::class => null, + Magento\GraphQl\Quote\GetMaskedQuoteIdByReservedOrderId::class => null, + Magento\Framework\Reflection\MethodsMap::class => null, + Magento\Framework\Reflection\DataObjectProcessor::class => null, + Magento\Framework\Api\DataObjectHelper::class => null, + Magento\Framework\Translate\Inline::class => null, + Magento\Framework\Json\Encoder::class => null, + Magento\Customer\Model\ResourceModel\Customer::class => null, + Magento\Customer\Model\ResourceModel\CustomerRepository::class => null, + Laminas\Uri\Uri::class => null, + Magento\Customer\Model\Session\Validators\CutoffValidator::class => null, + Magento\Customer\Model\Customer::class => null, + Magento\Customer\Model\Session\SessionCleaner::class => null, + Magento\Tax\Model\Calculation::class => null, + Magento\Tax\Model\TaxCalculation::class => null, + Magento\SalesRule\Model\RulesApplier::class => null, + Magento\OfflineShipping\Model\SalesRule\Calculator::class => null, + Magento\OfflineShipping\Model\Quote\Address\FreeShipping::class => null, + Magento\SalesRule\Model\Validator::class => null, + Magento\Quote\Model\Quote\Address\Total\Collector::class => null, + Magento\Quote\Model\Quote\TotalsCollectorList::class => null, + Magento\Quote\Model\Quote\TotalsCollector::class => null, + Magento\Payment\Gateway\Config\ConfigFactory::class => null, + Magento\Payment\Gateway\Data\Quote\AddressAdapterFactory::class => null, + ], + 'setPaymentMethodOnCart' => [ + Magento\Framework\Stdlib\ArrayManager::class => null, + Magento\Config\Model\Config\Processor\EnvironmentPlaceholder::class => null, + Magento\Framework\Reflection\MethodsMap::class => null, + Magento\Framework\Reflection\DataObjectProcessor::class => null, + Magento\Framework\Api\DataObjectHelper::class => null, + Magento\Framework\Translate\Inline::class => null, + Magento\Framework\Json\Encoder::class => null, + Magento\Customer\Model\ResourceModel\Customer::class => null, + Magento\Customer\Model\ResourceModel\CustomerRepository::class => null, + Laminas\Uri\Uri::class => null, + Magento\Customer\Model\Session\Validators\CutoffValidator::class => null, + Magento\Customer\Model\Customer::class => null, + Magento\Customer\Model\Session\SessionCleaner::class => null, + Magento\Tax\Model\Calculation::class => null, + Magento\Tax\Model\TaxCalculation::class => null, + Magento\SalesRule\Model\RulesApplier::class => null, + Magento\OfflineShipping\Model\SalesRule\Calculator::class => null, + Magento\OfflineShipping\Model\Quote\Address\FreeShipping::class => null, + Magento\SalesRule\Model\Validator::class => null, + Magento\Quote\Model\Quote\Address\Total\Collector::class => null, + Magento\Quote\Model\Quote\TotalsCollectorList::class => null, + Magento\Quote\Model\Quote\TotalsCollector::class => null, + ], + 'placeOrder' => [ + Magento\Framework\Lock\Proxy::class => null, + Magento\Framework\Url\QueryParamsResolver::class => null, + Magento\Framework\View\Asset\PreProcessor\Helper\Sort::class => null, + Magento\Framework\Filter\FilterManager::class => null, + Magento\Store\Model\Address\Renderer::class => null, + Magento\Quote\Model\ResourceModel\Quote::class => null, + Magento\Quote\Model\QuoteIdToMaskedQuoteId::class => null, + Magento\GraphQl\Quote\GetMaskedQuoteIdByReservedOrderId::class => null, + Magento\Framework\Reflection\MethodsMap::class => null, + Magento\Framework\Reflection\DataObjectProcessor::class => null, + Magento\Catalog\Model\Product\Attribute\Repository::class => null, + Magento\Catalog\Model\ResourceModel\Category::class => null, + Magento\Catalog\Model\ResourceModel\Product::class => null, + Magento\Framework\Api\DataObjectHelper::class => null, + Magento\CatalogGraphQl\Model\Resolver\Products\SearchCriteria\CollectionProcessor\FilterProcessor\CategoryFilter::class => null, + Magento\Framework\Translate\Inline::class => null, + Magento\Framework\Json\Encoder::class => null, + Magento\Directory\Helper\Data::class => null, + Magento\Customer\Model\ResourceModel\AddressRepository::class => null, + Magento\Customer\Model\ResourceModel\Customer::class => null, + Magento\Customer\Model\ResourceModel\CustomerRepository::class => null, + Laminas\Uri\Uri::class => null, + Magento\Customer\Model\Session\Validators\CutoffValidator::class => null, + Magento\Customer\Model\Customer::class => null, + Magento\Customer\Model\Session\SessionCleaner::class => null, + Magento\Tax\Model\Calculation::class => null, + Magento\Tax\Model\TaxCalculation::class => null, + Magento\SalesRule\Model\RulesApplier::class => null, + Magento\OfflineShipping\Model\SalesRule\Calculator::class => null, + Magento\OfflineShipping\Model\Quote\Address\FreeShipping::class => null, + Magento\SalesRule\Model\Validator::class => null, + Magento\Quote\Model\Quote\Address\Total\Collector::class => null, + Magento\Quote\Model\Quote\TotalsCollectorList::class => null, + Magento\Quote\Model\Quote\TotalsCollector::class => null, + Magento\Sales\Model\Order\ItemRepository::class => null, + Magento\Sales\Model\ResourceModel\Order\Payment::class => null, + Magento\Sales\Model\ResourceModel\Order\Relation::class => null, + Magento\Sales\Model\ResourceModel\Order::class => null, + Magento\Sales\Model\OrderIncrementIdChecker::class => null, + Magento\QuoteGraphQl\Plugin\ProductAttributesExtender::class => null, + Magento\Tax\Model\Quote\ToOrderConverter::class => null, + Magento\Quote\Model\Quote::class => null, + ], 'createCustomer' => [ Magento\Framework\Logger\LoggerProxy::class => null, Magento\Framework\View\Asset\PreProcessor\Helper\Sort::class => null, @@ -729,6 +1041,130 @@ Magento\SalesRule\Model\ResourceModel\Rule::class => null, Magento\SalesRule\Model\Plugin\QuoteConfigProductAttributes::class => null, Magento\QuoteGraphQl\Plugin\ProductAttributesExtender::class => null, + + //Create Empty Cart + Magento\Quote\Model\ResourceModel\Quote\QuoteIdMask::class => null, + Magento\Quote\Model\ResourceModel\Quote::class => null, + Magento\Quote\Model\QuoteIdToMaskedQuoteId::class => null, + Magento\Quote\Model\Cart\CustomerCartResolver::class => null, + Magento\QuoteGraphQl\Model\Cart\CreateEmptyCartForGuest::class => null, + Magento\Quote\Model\MaskedQuoteIdToQuoteId::class => null, + Magento\SalesRule\Model\RulesApplier::class => null, + Magento\OfflineShipping\Model\SalesRule\Calculator::class => null, + Magento\Quote\Model\Quote\Address\Total\Shipping::class => null, + Magento\SalesRule\Model\Validator::class => null, + Magento\SalesRule\Model\Quote\Discount::class => null, + Magento\Weee\Model\Total\Quote\Weee::class => null, + Magento\Quote\Model\Quote\Address\Total\Collector::class => null, + Magento\Quote\Model\Quote\Interceptor::class => null, + Magento\Quote\Model\ResourceModel\Quote\Address::class => null, + Magento\Quote\Model\Quote\Address::class => null, + Magento\Quote\Model\ShippingMethodManagement::class => null, + Magento\Quote\Model\ResourceModel\Quote\Item\Collection\Interceptor::class => null, + Magento\Quote\Model\Quote\Address\Total::class => null, + Laminas\Validator\ValidatorChain::class => null, + + //Add Simple Product to Cart + Magento\Catalog\Model\Product\Interceptor::class => null, + Magento\Catalog\Model\Product\Attribute\Backend\Price\Interceptor::class => null, + Magento\Catalog\Model\Product\Attribute\Backend\Tierprice\Interceptor::class => null, + Magento\Catalog\Model\Product\Attribute\Backend\Boolean\Interceptor::class => null, + Magento\Catalog\Model\Product\Attribute\Backend\LayoutUpdate\Interceptor::class => null, + Magento\Catalog\Model\Product\Attribute\Backend\Stock\Interceptor::class => null, + Magento\Catalog\Model\Product\Attribute\Backend\Weight\Interceptor::class => null, + Magento\Catalog\Model\ResourceModel\Product\CategoryLink::class => null, + Magento\Catalog\Model\Category\Link\ReadHandler::class => null, + Laminas\Validator\Uri::class => null, + Magento\Quote\Model\ResourceModel\Quote\Item::class => null, + Magento\Quote\Model\Quote\Item::class => null, + Magento\Quote\Model\ResourceModel\Quote\Item\Option::class => null, + Magento\Quote\Model\Quote\Item\Option::class => null, + Magento\User\Model\User\Interceptor::class => null, + Magento\Quote\Model\ShippingAssignment::class => null, + Magento\Quote\Model\Shipping::class => null, + + //Add Virtual Product to Cart + Magento\Catalog\Model\Product\Type\Virtual\Interceptor::class => null, + + //Add Bundle Product to Cart + Magento\CatalogInventory\Model\StockRegistryProvider::class => null, + Magento\CatalogInventory\Model\StockRegistry::class => null, + Magento\CatalogInventory\Helper\Stock::class => null, + Magento\Catalog\Model\Product\Link\Interceptor::class => null, + Magento\Catalog\Model\Config::class => null, + Magento\Bundle\Model\Product\Type\Interceptor::class => null, + Magento\Bundle\Model\Product\LinksList::class => null, + Magento\Bundle\Model\Product\OptionList::class => null, + Magento\Bundle\Model\Option\SaveAction::class => null, + Magento\Bundle\Model\OptionRepository::class => null, + Magento\CatalogInventory\Model\AddStockStatusToCollection::class => null, + Magento\Bundle\Model\ResourceModel\Option\Collection\Interceptor::class => null, + Magento\Bundle\Model\Link::class => null, + Magento\Bundle\Model\Option::class => null, + Magento\Bundle\Model\BundleOption::class => null, + Magento\Quote\Api\Data\ProductOptionExtension::class => null, + Magento\Quote\Model\Quote\ProductOption::class => null, + + //Add Configurable Products to cart + Magento\Catalog\Model\CategoryLink::class => null, + Magento\ConfigurableProduct\Model\Product\Type\Configurable\OptionValue::class => null, + Magento\ConfigurableProduct\Model\ResourceModel\Product\Type\Configurable\Attribute\Collection\Interceptor::class => null, + Magento\ConfigurableProduct\Model\Quote\Item\ConfigurableItemOptionValue::class => null, + + //Add downloadable Products to cart + Magento\Downloadable\Model\Product\Type\Interceptor::class => null, + Magento\Downloadable\Model\LinkRepository::class => null, + Magento\Downloadable\Model\SampleRepository::class => null, + Magento\Downloadable\Model\Link::class => null, + Magento\Downloadable\Model\ResourceModel\Sample\Collection\Interceptor::class => null, + Magento\Downloadable\Model\Sample::class => null, + Magento\Downloadable\Model\DownloadableOption::class => null, + + //Set shipping Address on Cart + Magento\Payment\Model\MethodList::class => null, + Magento\Quote\Model\PaymentMethodManagement::class => null, + Magento\Quote\Model\ResourceModel\Quote\Address\Rate::class => null, + Magento\Framework\ObjectManager\TMap::class => null, + Magento\Payment\Gateway\Config\ValueHandlerPool::class => null, + Magento\Payment\Model\Method\Adapter::class => null, + Magento\Tax\Model\Quote\GrandTotalDetailsPlugin::class => null, + + //Set Billing Address on Cart + Magento\Quote\Model\BillingAddressManagement::class => null, + Magento\QuoteGraphQl\Model\Cart\AssignBillingAddressToCart::class => null, + + //Set Payment Method on Cart + Magento\Captcha\Helper\Data::class => null, + Magento\Checkout\Model\CaptchaRateLimiter::class => null, + Magento\Captcha\Model\DefaultModel::class => null, + Magento\Quote\Model\ResourceModel\Quote\Payment::class => null, + Magento\CustomerGraphQl\Plugin\ClearCustomerSessionAfterRequest::class => null, + + //Place Order + Magento\Sales\Model\Order\ItemRepository\Interceptor::class => null, + Magento\Sales\Model\ResourceModel\Order\Interceptor::class => null, + Magento\Sales\Model\Order\Address\Validator::class => null, + Magento\Quote\Model\SubmitQuoteValidator::class => null, + Magento\Sales\Model\Order\Email\Sender\OrderSender::class => null, + Magento\Catalog\Model\Indexer\Product\Price\DimensionModeConfiguration::class => null, + Magento\Catalog\Model\Indexer\Product\Price\PriceTableResolver::class => null, + Magento\Sales\Model\Order\Config::class => null, + Magento\Sales\Model\Order\Interceptor::class => null, + Magento\Sales\Model\ResourceModel\Order\Address::class => null, + Magento\Sales\Model\Order\Address::class => null, + Magento\Sales\Model\Order\CreditmemoFactory::class => null, + Magento\Sales\Model\Order\Payment\Interceptor::class => null, + Magento\Sales\Model\ResourceModel\Order\Item::class => null, + Magento\Sales\Model\Order\Item\Interceptor::class => null, + Magento\OfflinePayments\Model\Checkmo::class => null, + Magento\Sales\Model\ResourceModel\Order\Status\Collection\Interceptor::class => null, + Magento\Paypal\Model\Pro::class => null, + Magento\Paypal\Model\Api\Nvp::class => null, + Magento\Sales\Model\ResourceModel\Order\Invoice\Collection\Interceptor::class => null, + Magento\CatalogSearch\Model\ResourceModel\EngineProvider::class => null, + Magento\Catalog\Model\Indexer\Product\Price\DimensionCollectionFactory::class => null, + Magento\Indexer\Model\Mview\View\State\Interceptor::class => null, + Magento\Framework\Mview\View::class => null, ], '' => [ ], From e4e360bce0a6ca5e86aa988aa162f05e165c9f5d Mon Sep 17 00:00:00 2001 From: Aakash Kumar Date: Wed, 4 Oct 2023 10:35:39 -0500 Subject: [PATCH 08/31] ACPT-1617: Add checkout mutations to GraphQlStateTest --- .../App/GraphQlCheckoutMutationsStateTest.php | 2 +- .../Magento/GraphQl/_files/state-skip-list.php | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/dev/tests/integration/testsuite/Magento/GraphQl/App/GraphQlCheckoutMutationsStateTest.php b/dev/tests/integration/testsuite/Magento/GraphQl/App/GraphQlCheckoutMutationsStateTest.php index 659cabaaf93cb..8e34b94a33816 100644 --- a/dev/tests/integration/testsuite/Magento/GraphQl/App/GraphQlCheckoutMutationsStateTest.php +++ b/dev/tests/integration/testsuite/Magento/GraphQl/App/GraphQlCheckoutMutationsStateTest.php @@ -101,7 +101,7 @@ public function testAddVirtualProductToCart() ['cartId' => $cartId, 'quantity' => 1, 'sku' => 'virtual_product'], [], [], - 'addSimpleProductsToCart', + 'addVirtualProductsToCart', '"data":{"addVirtualProductsToCart":', $this ); diff --git a/dev/tests/integration/testsuite/Magento/GraphQl/_files/state-skip-list.php b/dev/tests/integration/testsuite/Magento/GraphQl/_files/state-skip-list.php index a6c098cd3ad06..ca62bd0c1d48c 100644 --- a/dev/tests/integration/testsuite/Magento/GraphQl/_files/state-skip-list.php +++ b/dev/tests/integration/testsuite/Magento/GraphQl/_files/state-skip-list.php @@ -37,7 +37,11 @@ 'resolveUrl' => [ Magento\Framework\GraphQl\Query\Fields::class => null, ], + 'createEmptyCart' => [ + Magento\Quote\Model\Quote\Address\Interceptor::class => null, + ], 'addSimpleProductsToCart' => [ + Magento\Quote\Model\Quote\Item\Interceptor::class => null, Magento\Framework\Stdlib\ArrayManager::class => null, Magento\Config\Model\Config\Processor\EnvironmentPlaceholder::class => null, Magento\Quote\Model\ResourceModel\Quote::class => null, @@ -79,7 +83,11 @@ Magento\Quote\Api\Data\ProductOptionExtensionFactory::class => null, Magento\Catalog\Model\CustomOptions\CustomOptionProcessor::class => null, ], + 'addVirtualProductsToCart' => [ + Magento\Quote\Model\Quote\Item\Interceptor::class => null, + ], 'addBundleProductsToCart' => [ + Magento\Catalog\Model\Config::class => null, Magento\Framework\Stdlib\ArrayManager::class => null, Magento\Config\Model\Config\Processor\EnvironmentPlaceholder::class => null, Magento\Quote\Model\ResourceModel\Quote::class => null, @@ -121,6 +129,7 @@ Magento\Catalog\Model\CustomOptions\CustomOptionProcessor::class => null, ], 'addConfigurableProductsToCart' => [ + Magento\Quote\Model\Quote\Item\Interceptor::class => null, Magento\Framework\Stdlib\ArrayManager::class => null, Magento\Config\Model\Config\Processor\EnvironmentPlaceholder::class => null, Magento\Quote\Model\ResourceModel\Quote::class => null, @@ -165,6 +174,7 @@ Magento\Catalog\Model\CustomOptions\CustomOptionProcessor::class => null, ], 'addDownloadableProductsToCart' => [ + Magento\Quote\Model\Quote\Item\Interceptor::class => null, Magento\Framework\Stdlib\ArrayManager::class => null, Magento\Config\Model\Config\Processor\EnvironmentPlaceholder::class => null, Magento\Quote\Model\ResourceModel\Quote::class => null, @@ -231,6 +241,7 @@ Magento\Framework\Reflection\MethodsMap::class => null, ], 'setBillingAddressOnCart' => [ + Magento\Quote\Model\Quote\Address\Interceptor::class => null, Magento\Framework\Reflection\MethodsMap::class => null, Magento\Framework\Reflection\DataObjectProcessor::class => null, Magento\Framework\Api\DataObjectHelper::class => null, @@ -892,6 +903,8 @@ Magento\TestFramework\Db\Adapter\Mysql\Interceptor::class => null, Magento\Indexer\Model\Indexer::class => null, Magento\Indexer\Model\Indexer\DependencyDecorator::class => null, + Magento\InventorySales\Model\IsProductSalableForRequestedQtyCondition\IsProductSalableForRequestedQtyConditionChain::class => null, + Magento\InventorySales\Model\AreProductsSalableForRequestedQty::class => null, ], '*-fromConstructed' => [ Magento\GraphQl\App\State\ObjectManager::class => null, From 3f77db68a54c06764341c4acba3503d24263a419 Mon Sep 17 00:00:00 2001 From: Aakash Kumar Date: Wed, 4 Oct 2023 13:29:23 -0500 Subject: [PATCH 09/31] ACPT-1617: Add checkout mutations to GraphQlStateTest --- .../GraphQl/_files/state-skip-list.php | 88 +++++++++++++++++++ 1 file changed, 88 insertions(+) diff --git a/dev/tests/integration/testsuite/Magento/GraphQl/_files/state-skip-list.php b/dev/tests/integration/testsuite/Magento/GraphQl/_files/state-skip-list.php index ca62bd0c1d48c..7d7bf72fdf51a 100644 --- a/dev/tests/integration/testsuite/Magento/GraphQl/_files/state-skip-list.php +++ b/dev/tests/integration/testsuite/Magento/GraphQl/_files/state-skip-list.php @@ -82,9 +82,65 @@ Magento\Quote\Model\Quote\ProductOptionFactory::class => null, Magento\Quote\Api\Data\ProductOptionExtensionFactory::class => null, Magento\Catalog\Model\CustomOptions\CustomOptionProcessor::class => null, + Magento\InventorySalesAsyncOrder\Model\ReservationExecution::class => null, + 'orderMetadata' => null, + Magento\Sales\Api\Data\OrderSearchResultInterfaceFactory::class => null, + Magento\Sales\Api\Data\OrderExtensionFactory::class => null, + Magento\Payment\Api\Data\PaymentAdditionalInfoInterfaceFactory::class => null, + Magento\Sales\Model\OrderRepository::class => null, + Magento\InventorySalesAsyncOrder\Plugin\SkipAsyncOrderCheckDataWithNoDeferredStockUpdatePlugin::class => null, + Magento\InventoryInStorePickup\Model\ExtractPickupLocationAddressData::class => null, + Magento\InventoryInStorePickupQuote\Model\ExtractQuoteAddressShippingAddressData::class => null, + Magento\InventoryInStorePickupQuote\Model\GetShippingAddressData::class => null, + Magento\InventoryInStorePickupQuote\Model\IsPickupLocationShippingAddress::class => null, + Magento\InventoryInStorePickupQuote\Model\ToQuoteAddress::class => null, + Magento\InventoryInStorePickupQuote\Model\GetWebsiteCodeByStoreId::class => null, + Magento\InventoryInStorePickupQuote\Plugin\Quote\ReplaceShippingAddressForShippingAddressManagement::class => null, + Magento\CustomerCustomAttributes\Model\ResourceModel\Sales\Quote::class => null, ], 'addVirtualProductsToCart' => [ + Magento\Framework\Stdlib\ArrayManager::class => null, Magento\Quote\Model\Quote\Item\Interceptor::class => null, + Magento\Config\Model\Config\Processor\EnvironmentPlaceholder::class => null, + Magento\Quote\Model\ResourceModel\Quote::class => null, + Magento\Quote\Model\QuoteIdToMaskedQuoteId::class => null, + Magento\GraphQl\Quote\GetMaskedQuoteIdByReservedOrderId::class => null, + Magento\Framework\Reflection\MethodsMap::class => null, + Magento\Framework\Reflection\DataObjectProcessor::class => null, + Magento\Framework\Api\DataObjectHelper::class => null, + Magento\Catalog\Model\ResourceModel\Product::class => null, + Magento\Catalog\Model\ProductRepository::class => null, + Magento\CatalogInventory\Model\StockRegistryProvider::class => null, + Magento\CatalogInventory\Model\StockRegistry::class => null, + Magento\Framework\Translate\Inline::class => null, + Magento\Framework\Json\Encoder::class => null, + Magento\Customer\Model\ResourceModel\Customer::class => null, + Magento\Customer\Model\ResourceModel\CustomerRepository::class => null, + Laminas\Uri\Uri::class => null, + Magento\Customer\Model\Session\Validators\CutoffValidator::class => null, + Magento\Customer\Model\Customer::class => null, + Magento\Customer\Model\Session\SessionCleaner::class => null, + Magento\Tax\Model\Calculation::class => null, + Magento\Tax\Model\TaxCalculation::class => null, + Magento\SalesRule\Model\RulesApplier::class => null, + Magento\OfflineShipping\Model\SalesRule\Calculator::class => null, + Magento\OfflineShipping\Model\Quote\Address\FreeShipping::class => null, + Magento\SalesRule\Model\Validator::class => null, + Magento\Quote\Model\Quote\Address\Total\Collector::class => null, + Magento\Quote\Model\Quote\TotalsCollectorList::class => null, + Magento\Quote\Model\Quote\TotalsCollector::class => null, + Magento\CustomerCustomAttributes\Model\ResourceModel\Sales\Quote::class => null, + Magento\User\Helper\Data::class => null, + Magento\Authorization\Model\RoleFactory::class => null, + Magento\User\Model\UserValidationRules::class => null, + Magento\Framework\Acl\Data\Cache::class => null, + Magento\User\Model\Backend\Config\ObserverConfig::class => null, + Magento\User\Model\ResourceModel\User::class => null, + Magento\User\Model\Notificator::class => null, + Magento\TestModuleCatalogInventoryCache\Plugin\PreventCachingPreloadedStockDataInToStockRegistry::class => null, + Magento\Quote\Model\Quote\ProductOptionFactory::class => null, + Magento\Quote\Api\Data\ProductOptionExtensionFactory::class => null, + Magento\Catalog\Model\CustomOptions\CustomOptionProcessor::class => null, ], 'addBundleProductsToCart' => [ Magento\Catalog\Model\Config::class => null, @@ -127,6 +183,13 @@ Magento\Bundle\Model\CartItemProcessor::class => null, Magento\Quote\Model\Quote\ProductOptionFactory::class => null, Magento\Catalog\Model\CustomOptions\CustomOptionProcessor::class => null, + Magento\Quote\Model\Quote\Item\Interceptor::class => null, + Magento\Staging\Model\VersionManager::class => null, + Magento\Staging\Model\Url\BaseUrlModifier::class => null, + Magento\Staging\Model\Event\Manager::class => null, + Magento\CustomerCustomAttributes\Model\ResourceModel\Sales\Quote::class => null, + Magento\CatalogStaging\Plugin\Catalog\Model\Indexer\AbstractFlatState::class => null, + ], 'addConfigurableProductsToCart' => [ Magento\Quote\Model\Quote\Item\Interceptor::class => null, @@ -359,6 +422,10 @@ Magento\QuoteGraphQl\Plugin\ProductAttributesExtender::class => null, Magento\Tax\Model\Quote\ToOrderConverter::class => null, Magento\Quote\Model\Quote::class => null, + Magento\Sales\Model\ResourceModel\Attribute::class => null, + Magento\Sales\Model\ResourceModel\Order\Handler\Address::class => null, + Magento\Sales\Model\ResourceModel\Order\Status\History::class => null, + Magento\CustomerCustomAttributes\Model\ResourceModel\Sales\Quote::class => null, ], 'createCustomer' => [ Magento\Framework\Logger\LoggerProxy::class => null, @@ -1178,6 +1245,27 @@ Magento\Catalog\Model\Indexer\Product\Price\DimensionCollectionFactory::class => null, Magento\Indexer\Model\Mview\View\State\Interceptor::class => null, Magento\Framework\Mview\View::class => null, + Magento\Framework\Validator\EmailAddress::class => null, + Magento\Framework\Amqp\ConfigPool::class => null, + Magento\Framework\Amqp\ExchangeFactory::class => null, + Magento\Framework\MessageQueue\MessageEncoder::class => null, + Magento\Framework\MessageQueue\MessageValidator::class => null, + Magento\Framework\MessageQueue\Bulk\Publisher::class => null, + Magento\Framework\MessageQueue\Bulk\Rpc\Publisher::class => null, + Magento\InventorySales\Plugin\InventoryReservationsApi\PreventAppendReservationOnNotManageItemsInStockPlugin::class => null, + Magento\Framework\MessageQueue\ExchangeRepository::class => null, + Magento\Framework\MessageQueue\Publisher::class => null, + Magento\Framework\MessageQueue\Rpc\Publisher::class => null, + Magento\Framework\MessageQueue\PublisherPool::class => null, + Magento\InventoryIndexer\Plugin\InventorySales\EnqueueAfterPlaceReservationsForSalesEvent::class => null, + Magento\Framework\Amqp\Config::class => null, + Magento\Framework\Amqp\Exchange::class => null, + PhpAmqpLib\Connection\AMQPStreamConnection::class => null, + Magento\CatalogInventory\Model\Indexer\Stock\CacheCleaner::class => null, + Magento\InventoryCatalogSearch\Plugin\CatalogSearch\Model\Indexer\ChildProductFilterByInventoryStockPlugin::class => null, + Magento\InventoryElasticsearch\Plugin\CatalogSearch\Model\Indexer\Fulltext\Action\DataProvider\StockedProductFilterByInventoryStock::class => null, + Magento\Widget\Model\ResourceModel\Layout\Update::class => null, + Magento\Widget\Model\ResourceModel\Layout\Plugin::class => null, ], '' => [ ], From b07240c1629ab99c6840e758f804114cbc5a4fdd Mon Sep 17 00:00:00 2001 From: Aakash Kumar Date: Wed, 4 Oct 2023 15:20:01 -0500 Subject: [PATCH 10/31] ACPT-1617: Add checkout mutations to GraphQlStateTest --- .../GraphQl/_files/state-skip-list.php | 44 ++++++++++++++++++- 1 file changed, 43 insertions(+), 1 deletion(-) diff --git a/dev/tests/integration/testsuite/Magento/GraphQl/_files/state-skip-list.php b/dev/tests/integration/testsuite/Magento/GraphQl/_files/state-skip-list.php index 7d7bf72fdf51a..641758a8f33fa 100644 --- a/dev/tests/integration/testsuite/Magento/GraphQl/_files/state-skip-list.php +++ b/dev/tests/integration/testsuite/Magento/GraphQl/_files/state-skip-list.php @@ -141,6 +141,13 @@ Magento\Quote\Model\Quote\ProductOptionFactory::class => null, Magento\Quote\Api\Data\ProductOptionExtensionFactory::class => null, Magento\Catalog\Model\CustomOptions\CustomOptionProcessor::class => null, + Magento\InventorySalesAsyncOrder\Model\ReservationExecution::class => null, + 'orderMetadata' => null, + Magento\Sales\Api\Data\OrderSearchResultInterfaceFactory::class => null, + Magento\Sales\Api\Data\OrderExtensionFactory::class => null, + Magento\Payment\Api\Data\PaymentAdditionalInfoInterfaceFactory::class => null, + Magento\Sales\Model\OrderRepository::class => null, + Magento\InventorySalesAsyncOrder\Plugin\SkipAsyncOrderCheckDataWithNoDeferredStockUpdatePlugin::class => null, ], 'addBundleProductsToCart' => [ Magento\Catalog\Model\Config::class => null, @@ -189,7 +196,20 @@ Magento\Staging\Model\Event\Manager::class => null, Magento\CustomerCustomAttributes\Model\ResourceModel\Sales\Quote::class => null, Magento\CatalogStaging\Plugin\Catalog\Model\Indexer\AbstractFlatState::class => null, - + Magento\InventorySalesAsyncOrder\Model\ReservationExecution::class => null, + 'orderMetadata' => null, + Magento\Sales\Api\Data\OrderSearchResultInterfaceFactory::class => null, + Magento\Sales\Api\Data\OrderExtensionFactory::class => null, + Magento\Payment\Api\Data\PaymentAdditionalInfoInterfaceFactory::class => null, + Magento\Sales\Model\OrderRepository::class => null, + Magento\InventorySalesAsyncOrder\Plugin\SkipAsyncOrderCheckDataWithNoDeferredStockUpdatePlugin::class => null, + Magento\InventoryInStorePickup\Model\ExtractPickupLocationAddressData::class => null, + Magento\InventoryInStorePickupQuote\Model\ExtractQuoteAddressShippingAddressData::class => null, + Magento\InventoryInStorePickupQuote\Model\GetShippingAddressData::class => null, + Magento\InventoryInStorePickupQuote\Model\IsPickupLocationShippingAddress::class => null, + Magento\InventoryInStorePickupQuote\Model\ToQuoteAddress::class => null, + Magento\InventoryInStorePickupQuote\Model\GetWebsiteCodeByStoreId::class => null, + Magento\InventoryInStorePickupQuote\Plugin\Quote\ReplaceShippingAddressForShippingAddressManagement::class => null, ], 'addConfigurableProductsToCart' => [ Magento\Quote\Model\Quote\Item\Interceptor::class => null, @@ -235,6 +255,20 @@ Magento\Quote\Api\Data\ProductOptionExtensionFactory::class => null, Magento\ConfigurableProduct\Model\Quote\Item\CartItemProcessor::class => null, Magento\Catalog\Model\CustomOptions\CustomOptionProcessor::class => null, + Magento\InventorySalesAsyncOrder\Model\ReservationExecution::class => null, + 'orderMetadata' => null, + Magento\Sales\Api\Data\OrderSearchResultInterfaceFactory::class => null, + Magento\Sales\Api\Data\OrderExtensionFactory::class => null, + Magento\Payment\Api\Data\PaymentAdditionalInfoInterfaceFactory::class => null, + Magento\Sales\Model\OrderRepository::class => null, + Magento\InventorySalesAsyncOrder\Plugin\SkipAsyncOrderCheckDataWithNoDeferredStockUpdatePlugin::class => null, + Magento\InventoryInStorePickup\Model\ExtractPickupLocationAddressData::class => null, + Magento\InventoryInStorePickupQuote\Model\ExtractQuoteAddressShippingAddressData::class => null, + Magento\InventoryInStorePickupQuote\Model\GetShippingAddressData::class => null, + Magento\InventoryInStorePickupQuote\Model\IsPickupLocationShippingAddress::class => null, + Magento\InventoryInStorePickupQuote\Model\ToQuoteAddress::class => null, + Magento\InventoryInStorePickupQuote\Model\GetWebsiteCodeByStoreId::class => null, + Magento\InventoryInStorePickupQuote\Plugin\Quote\ReplaceShippingAddressForShippingAddressManagement::class => null, ], 'addDownloadableProductsToCart' => [ Magento\Quote\Model\Quote\Item\Interceptor::class => null, @@ -1143,6 +1177,10 @@ Magento\Quote\Model\ResourceModel\Quote\Item\Collection\Interceptor::class => null, Magento\Quote\Model\Quote\Address\Total::class => null, Laminas\Validator\ValidatorChain::class => null, + Magento\CustomerCustomAttributes\Model\ResourceModel\Sales\Quote\Address::class => null, + Magento\CustomerCustomAttributes\Model\ResourceModel\Sales\Quote::class => null, + Magento\Indexer\Model\Indexer\DeferCacheCleaning::class => null, + //Add Simple Product to Cart Magento\Catalog\Model\Product\Interceptor::class => null, @@ -1162,9 +1200,13 @@ Magento\User\Model\User\Interceptor::class => null, Magento\Quote\Model\ShippingAssignment::class => null, Magento\Quote\Model\Shipping::class => null, + Magento\GiftCard\Model\Attribute\Backend\Giftcard\Amount\Interceptor::class => null, + Magento\TargetRule\Model\Catalog\Product\Attribute\Backend\Rule\Interceptor::class => null, + Magento\NegotiableQuote\Model\NegotiableQuote\Interceptor::class => null, //Add Virtual Product to Cart Magento\Catalog\Model\Product\Type\Virtual\Interceptor::class => null, + Magento\NegotiableQuote\Model\NegotiableQuote\Interceptor::class => null, //Add Bundle Product to Cart Magento\CatalogInventory\Model\StockRegistryProvider::class => null, From 8da6f8f92e786818ff58d00b0e5c15e1cea93f1b Mon Sep 17 00:00:00 2001 From: Aakash Kumar Date: Wed, 4 Oct 2023 19:43:36 -0500 Subject: [PATCH 11/31] ACPT-1617: Add checkout mutations to GraphQlStateTest --- .../GraphQl/_files/state-skip-list.php | 56 ++++++++++++++++++- 1 file changed, 55 insertions(+), 1 deletion(-) diff --git a/dev/tests/integration/testsuite/Magento/GraphQl/_files/state-skip-list.php b/dev/tests/integration/testsuite/Magento/GraphQl/_files/state-skip-list.php index 641758a8f33fa..93e9e4f9d1ae5 100644 --- a/dev/tests/integration/testsuite/Magento/GraphQl/_files/state-skip-list.php +++ b/dev/tests/integration/testsuite/Magento/GraphQl/_files/state-skip-list.php @@ -39,6 +39,19 @@ ], 'createEmptyCart' => [ Magento\Quote\Model\Quote\Address\Interceptor::class => null, + Magento\GraphQlNewRelic\Plugin\ReportError::class => null, + Magento\Customer\Model\ResourceModel\Attribute::class => null, + Magento\Eav\Api\Data\AttributeExtensionFactory::class => null, + Magento\Eav\Model\Entity\Attribute\FrontendLabelFactory::class => null, + Magento\Eav\Model\Validator\Attribute\Code::class => null, + Magento\Catalog\Model\Product\ReservedAttributeList::class => null, + Magento\Catalog\Model\Product\ReservedAttributeCheckerAdapter::class => null, + Magento\Company\Model\ResourceModel\Company::class => null, + Magento\Company\Model\Company::class => null, + Magento\Company\Model\Company\ReservedAttributeList::class => null, + Magento\Eav\Model\ReservedAttributeChecker::class => null, + Magento\GraphQlNewRelic\Plugin\ReportError::class => null + ], 'addSimpleProductsToCart' => [ Magento\Quote\Model\Quote\Item\Interceptor::class => null, @@ -97,6 +110,12 @@ Magento\InventoryInStorePickupQuote\Model\GetWebsiteCodeByStoreId::class => null, Magento\InventoryInStorePickupQuote\Plugin\Quote\ReplaceShippingAddressForShippingAddressManagement::class => null, Magento\CustomerCustomAttributes\Model\ResourceModel\Sales\Quote::class => null, + Magento\Customer\Model\ResourceModel\Attribute::class => null, + Magento\GraphQlNewRelic\Plugin\ReportError::class => null, + Magento\NegotiableQuote\Model\Plugin\Quote\Model\ShippingAssignmentPersisterPlugin::class => null, + Magento\PurchaseOrder\Plugin\Quote\Model\QuoteRepositoryPlugin::class => null, + Magento\Customer\Model\ResourceModel\Attribute::class => null, + Magento\GraphQlNewRelic\Plugin\ReportError::class => null, ], 'addVirtualProductsToCart' => [ Magento\Framework\Stdlib\ArrayManager::class => null, @@ -148,6 +167,8 @@ Magento\Payment\Api\Data\PaymentAdditionalInfoInterfaceFactory::class => null, Magento\Sales\Model\OrderRepository::class => null, Magento\InventorySalesAsyncOrder\Plugin\SkipAsyncOrderCheckDataWithNoDeferredStockUpdatePlugin::class => null, + Magento\Customer\Model\ResourceModel\Attribute::class => null, + Magento\GraphQlNewRelic\Plugin\ReportError::class => null, ], 'addBundleProductsToCart' => [ Magento\Catalog\Model\Config::class => null, @@ -210,6 +231,10 @@ Magento\InventoryInStorePickupQuote\Model\ToQuoteAddress::class => null, Magento\InventoryInStorePickupQuote\Model\GetWebsiteCodeByStoreId::class => null, Magento\InventoryInStorePickupQuote\Plugin\Quote\ReplaceShippingAddressForShippingAddressManagement::class => null, + Magento\NegotiableQuote\Model\Plugin\Quote\Model\ShippingAssignmentPersisterPlugin::class => null, + Magento\PurchaseOrder\Plugin\Quote\Model\QuoteRepositoryPlugin::class => null, + Magento\Customer\Model\ResourceModel\Attribute::class => null, + Magento\GraphQlNewRelic\Plugin\ReportError::class => null, ], 'addConfigurableProductsToCart' => [ Magento\Quote\Model\Quote\Item\Interceptor::class => null, @@ -269,6 +294,7 @@ Magento\InventoryInStorePickupQuote\Model\ToQuoteAddress::class => null, Magento\InventoryInStorePickupQuote\Model\GetWebsiteCodeByStoreId::class => null, Magento\InventoryInStorePickupQuote\Plugin\Quote\ReplaceShippingAddressForShippingAddressManagement::class => null, + Magento\CustomerCustomAttributes\Model\ResourceModel\Sales\Quote::class => null ], 'addDownloadableProductsToCart' => [ Magento\Quote\Model\Quote\Item\Interceptor::class => null, @@ -311,6 +337,18 @@ Magento\Quote\Api\Data\ProductOptionExtensionFactory::class => null, Magento\Downloadable\Model\Quote\Item\CartItemProcessor::class => null, Magento\Catalog\Model\CustomOptions\CustomOptionProcessor::class => null, + Magento\Staging\Model\VersionManager::class => null, + Magento\Staging\Model\Url\BaseUrlModifier::class => null, + Magento\Staging\Model\Event\Manager::class => null, + Magento\CustomerCustomAttributes\Model\ResourceModel\Sales\Quote::class => null, + Magento\CatalogStaging\Plugin\Catalog\Model\Indexer\AbstractFlatState::class => null, + Magento\InventorySalesAsyncOrder\Model\ReservationExecution::class => null, + 'orderMetadata' => null, + Magento\Sales\Api\Data\OrderSearchResultInterfaceFactory::class => null, + Magento\Sales\Api\Data\OrderExtensionFactory::class => null, + Magento\Payment\Api\Data\PaymentAdditionalInfoInterfaceFactory::class => null, + Magento\Sales\Model\OrderRepository::class => null, + Magento\InventorySalesAsyncOrder\Plugin\SkipAsyncOrderCheckDataWithNoDeferredStockUpdatePlugin::class => null, ], 'setShippingAddressesOnCart' => [ setShippingAddressesOnCart::class => null, @@ -336,6 +374,7 @@ Magento\Quote\Model\Quote\TotalsCollectorList::class => null, Magento\Quote\Model\Quote\TotalsCollector::class => null, Magento\Framework\Reflection\MethodsMap::class => null, + Magento\GraphQlNewRelic\Plugin\ReportError::class => null, ], 'setBillingAddressOnCart' => [ Magento\Quote\Model\Quote\Address\Interceptor::class => null, @@ -360,7 +399,8 @@ Magento\SalesRule\Model\Validator::class => null, Magento\Quote\Model\Quote\Address\Total\Collector::class => null, Magento\Quote\Model\Quote\TotalsCollectorList::class => null, - Magento\Quote\Model\Quote\TotalsCollector::class => null + Magento\Quote\Model\Quote\TotalsCollector::class => null, + Magento\GraphQlNewRelic\Plugin\ReportError::class => null, ], 'setShippingMethodsOnCart' => [ Magento\Quote\Model\ResourceModel\Quote::class => null, @@ -388,6 +428,7 @@ Magento\Quote\Model\Quote\TotalsCollector::class => null, Magento\Payment\Gateway\Config\ConfigFactory::class => null, Magento\Payment\Gateway\Data\Quote\AddressAdapterFactory::class => null, + Magento\CustomerCustomAttributes\Model\ResourceModel\Sales\Quote::class => null, ], 'setPaymentMethodOnCart' => [ Magento\Framework\Stdlib\ArrayManager::class => null, @@ -412,6 +453,8 @@ Magento\Quote\Model\Quote\Address\Total\Collector::class => null, Magento\Quote\Model\Quote\TotalsCollectorList::class => null, Magento\Quote\Model\Quote\TotalsCollector::class => null, + Magento\Customer\Model\ResourceModel\Attribute::class => null, + Magento\GraphQlNewRelic\Plugin\ReportError::class => null, ], 'placeOrder' => [ Magento\Framework\Lock\Proxy::class => null, @@ -1261,6 +1304,7 @@ Magento\Captcha\Model\DefaultModel::class => null, Magento\Quote\Model\ResourceModel\Quote\Payment::class => null, Magento\CustomerGraphQl\Plugin\ClearCustomerSessionAfterRequest::class => null, + Magento\Company\Plugin\Framework\Model\ActionValidator\RemoveActionPlugin::class => null, //Place Order Magento\Sales\Model\Order\ItemRepository\Interceptor::class => null, @@ -1308,6 +1352,16 @@ Magento\InventoryElasticsearch\Plugin\CatalogSearch\Model\Indexer\Fulltext\Action\DataProvider\StockedProductFilterByInventoryStock::class => null, Magento\Widget\Model\ResourceModel\Layout\Update::class => null, Magento\Widget\Model\ResourceModel\Layout\Plugin::class => null, + Magento\Sales\Model\Order\Address\Interceptor::class => null, + Magento\OfflinePayments\Model\Checkmo\Interceptor::class => null, + Magento\CustomerCustomAttributes\Model\ResourceModel\Sales\Order::class => null, + Magento\CustomerCustomAttributes\Model\ResourceModel\Sales\Order\Address::class => null, + Magento\CatalogPermissions\Model\Indexer\TableMaintainer::class => null, + Magento\NegotiableQuote\Model\Restriction\Admin::class => null, + Magento\AsynchronousOperations\Model\BulkManagement::class => null, + Magento\SalesRule\Model\Service\CouponUsagePublisher::class => null, + Magento\Paypal\Model\Api\Nvp\Interceptor::class => null, + Magento\PurchaseOrder\Model\PurchaseOrder\LogManagement::class => null, ], '' => [ ], From a552999b8637755cd5b123696d0c5fbf97b3b7bd Mon Sep 17 00:00:00 2001 From: Aakash Kumar Date: Thu, 5 Oct 2023 10:39:17 -0500 Subject: [PATCH 12/31] ACPT-1617: Add checkout mutations to GraphQlStateTest --- .../GraphQl/_files/state-skip-list.php | 48 ++++++++++++++++++- 1 file changed, 47 insertions(+), 1 deletion(-) diff --git a/dev/tests/integration/testsuite/Magento/GraphQl/_files/state-skip-list.php b/dev/tests/integration/testsuite/Magento/GraphQl/_files/state-skip-list.php index 93e9e4f9d1ae5..831fa86897bbd 100644 --- a/dev/tests/integration/testsuite/Magento/GraphQl/_files/state-skip-list.php +++ b/dev/tests/integration/testsuite/Magento/GraphQl/_files/state-skip-list.php @@ -294,7 +294,11 @@ Magento\InventoryInStorePickupQuote\Model\ToQuoteAddress::class => null, Magento\InventoryInStorePickupQuote\Model\GetWebsiteCodeByStoreId::class => null, Magento\InventoryInStorePickupQuote\Plugin\Quote\ReplaceShippingAddressForShippingAddressManagement::class => null, - Magento\CustomerCustomAttributes\Model\ResourceModel\Sales\Quote::class => null + Magento\CustomerCustomAttributes\Model\ResourceModel\Sales\Quote::class => null, + Magento\NegotiableQuote\Model\Plugin\Quote\Model\ShippingAssignmentPersisterPlugin::class => null, + Magento\PurchaseOrder\Plugin\Quote\Model\QuoteRepositoryPlugin::class => null, + Magento\GraphQlNewRelic\Plugin\ReportError::class => null, + ], 'addDownloadableProductsToCart' => [ Magento\Quote\Model\Quote\Item\Interceptor::class => null, @@ -349,6 +353,8 @@ Magento\Payment\Api\Data\PaymentAdditionalInfoInterfaceFactory::class => null, Magento\Sales\Model\OrderRepository::class => null, Magento\InventorySalesAsyncOrder\Plugin\SkipAsyncOrderCheckDataWithNoDeferredStockUpdatePlugin::class => null, + Magento\Customer\Model\ResourceModel\Attribute::class => null, + Magento\GraphQlNewRelic\Plugin\ReportError::class => null, ], 'setShippingAddressesOnCart' => [ setShippingAddressesOnCart::class => null, @@ -503,6 +509,43 @@ Magento\Sales\Model\ResourceModel\Order\Handler\Address::class => null, Magento\Sales\Model\ResourceModel\Order\Status\History::class => null, Magento\CustomerCustomAttributes\Model\ResourceModel\Sales\Quote::class => null, + Magento\Indexer\Model\Indexer\DeferredCacheContext::class => null, + Magento\Indexer\Model\Indexer\DeferredCacheCleaner::class => null, + Magento\Catalog\Model\ResourceModel\Product\Indexer\Price\IndexTableStructureFactory::class => null, + Magento\Catalog\Model\ResourceModel\Product\Attribute\Backend\Tierprice::class => null, + Magento\Catalog\Model\ResourceModel\Product\Indexer\Price\TierPrice::class => null, + Magento\Catalog\Model\Indexer\Product\Price\TableMaintainer::class => null, + Magento\Store\Model\WebsiteManagement::class => null, + Magento\Catalog\Model\ResourceModel\Product\Indexer\Price\IndexTableRowSizeEstimator::class => null, + Magento\Catalog\Model\Indexer\Price\BatchSizeManagement::class => null, + Magento\Framework\Indexer\Table\Strategy::class => null, + Magento\CatalogRule\Model\ResourceModel\Rule\Product\Price::class => null, + Magento\CatalogRule\Model\Indexer\ProductPriceIndexModifier::class => null, + Magento\CatalogInventory\Model\Indexer\ProductPriceIndexFilter::class => null, + Magento\Catalog\Model\ResourceModel\Product\Indexer\Price\DefaultPrice::class => null, + Magento\Catalog\Model\ResourceModel\Product\Indexer\Price\CompositeProductRelationsCalculator::class => null, + Magento\Catalog\Model\ResourceModel\Product\Indexer\Price\CompositeProductRowSizeEstimator::class => null, + Magento\Catalog\Model\Indexer\Price\CompositeProductBatchSizeManagement::class => null, + Magento\Catalog\Model\ResourceModel\Product\Indexer\Price\CompositeProductBatchSizeAdjuster::class => null, + Magento\Catalog\Model\ResourceModel\Product\Indexer\Price\BatchSizeCalculator::class => null, + Magento\InventoryConfigurableProduct\Pricing\Price\Indexer\BaseStockStatusSelectProcessor::class => null, + Magento\ConfigurableProduct\Model\ResourceModel\Product\Indexer\Price\OptionsSelectBuilder::class => null, + Magento\InventoryConfigurableProduct\Pricing\Price\Indexer\OptionsIndexer::class => null, + Magento\InventoryCatalog\Plugin\CatalogInventory\Model\Indexer\ModifySelectInProductPriceIndexFilter::class => null, + Magento\Indexer\Model\Indexer\DeferCacheCleaning::class => null, + Magento\SalesRule\Model\RuleFactory::class => null, + Magento\SalesRule\Api\Data\RuleInterfaceFactory::class => null, + Magento\SalesRule\Api\Data\ConditionInterfaceFactory::class => null, + Magento\SalesRule\Api\Data\RuleLabelInterfaceFactory::class => null, + Magento\SalesRule\Model\Converter\ToDataModel::class => null, + Magento\SalesRule\Model\Converter\ToModel::class => null, + Magento\SalesRule\Api\Data\RuleSearchResultInterfaceFactory::class => null, + Magento\SalesRule\Model\RuleRepository::class => null, + Magento\Reward\Model\SalesRule\RewardPointCounter::class => null, + Magento\GraphQlNewRelic\Plugin\ReportError::class => null, + Magento\NegotiableQuote\Model\Restriction\Customer::class => null, + Magento\NegotiableQuote\Model\Restriction\Admin::class => null, + Magento\SharedCatalog\Plugin\Catalog\Model\ResourceModel\Product\Indexer\BaseFinalPricePlugin::class => null, ], 'createCustomer' => [ Magento\Framework\Logger\LoggerProxy::class => null, @@ -1298,6 +1341,9 @@ Magento\Quote\Model\BillingAddressManagement::class => null, Magento\QuoteGraphQl\Model\Cart\AssignBillingAddressToCart::class => null, + //Set Shipping Method on Cart + Magento\NegotiableQuote\Plugin\Quote\Api\JoinNegotiableQuoteTotalsPlugin::class => null, + //Set Payment Method on Cart Magento\Captcha\Helper\Data::class => null, Magento\Checkout\Model\CaptchaRateLimiter::class => null, From 4951f95b5a2854e77ce17a2ecaf68997d6d9e84a Mon Sep 17 00:00:00 2001 From: Aakash Kumar Date: Thu, 5 Oct 2023 12:25:50 -0500 Subject: [PATCH 13/31] ACPT-1617: Add checkout mutations to GraphQlStateTest --- .../testsuite/Magento/GraphQl/_files/state-skip-list.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dev/tests/integration/testsuite/Magento/GraphQl/_files/state-skip-list.php b/dev/tests/integration/testsuite/Magento/GraphQl/_files/state-skip-list.php index 831fa86897bbd..dd40634748fb9 100644 --- a/dev/tests/integration/testsuite/Magento/GraphQl/_files/state-skip-list.php +++ b/dev/tests/integration/testsuite/Magento/GraphQl/_files/state-skip-list.php @@ -435,6 +435,8 @@ Magento\Payment\Gateway\Config\ConfigFactory::class => null, Magento\Payment\Gateway\Data\Quote\AddressAdapterFactory::class => null, Magento\CustomerCustomAttributes\Model\ResourceModel\Sales\Quote::class => null, + Magento\Customer\Model\ResourceModel\Attribute::class => null, + Magento\GraphQlNewRelic\Plugin\ReportError::class => null, ], 'setPaymentMethodOnCart' => [ Magento\Framework\Stdlib\ArrayManager::class => null, From 5051a0b2fbe1342f5b2ac5451d3aac22dd7daf24 Mon Sep 17 00:00:00 2001 From: Aakash Kumar Date: Fri, 6 Oct 2023 10:59:07 -0500 Subject: [PATCH 14/31] ACPT-1617: Add checkout mutations to GraphQlStateTest --- .../App/GraphQlCustomerMutationsTest.php | 30 ++++++++----------- 1 file changed, 13 insertions(+), 17 deletions(-) diff --git a/dev/tests/integration/testsuite/Magento/GraphQl/App/GraphQlCustomerMutationsTest.php b/dev/tests/integration/testsuite/Magento/GraphQl/App/GraphQlCustomerMutationsTest.php index 437495c96b1e2..d35eb808e39e6 100644 --- a/dev/tests/integration/testsuite/Magento/GraphQl/App/GraphQlCustomerMutationsTest.php +++ b/dev/tests/integration/testsuite/Magento/GraphQl/App/GraphQlCustomerMutationsTest.php @@ -8,6 +8,7 @@ namespace Magento\GraphQl\App; use Magento\Customer\Api\CustomerRepositoryInterface; +use Magento\Framework\Exception\NoSuchEntityException; use Magento\Framework\Registry; use Magento\GraphQl\App\State\GraphQlStateDiff; @@ -21,15 +22,11 @@ */ class GraphQlCustomerMutationsTest extends \PHPUnit\Framework\TestCase { - - - /** @var CustomerRepositoryInterface */ private CustomerRepositoryInterface $customerRepository; - /** @var Registry */ - private $registry; + private Registry $registry; - private $graphQlStateDiff; + private GraphQlStateDiff $graphQlStateDiff; /** * @inheritDoc @@ -73,25 +70,24 @@ public function testCustomerState( } /** - * @param string $email + * @param array $emails * @return void */ - private function clearCustomerBeforeTest(array $emails ): void + private function clearCustomerBeforeTest(array &$emails): void { $this->customerRepository = $this->graphQlStateDiff->getTestObjectManager() ->get(CustomerRepositoryInterface::class); $this->registry = $this->graphQlStateDiff->getTestObjectManager()->get(Registry::class); $this->registry->register('isSecureArea', true); - try { - $customer = $this->customerRepository->get(array_pop($emails)); - $this->customerRepository->delete($customer); - $customer2 = $this->customerRepository->get(array_pop($emails)); - $this->customerRepository->delete($customer2); - } catch (\Exception $e) { - // Customer does not exist - } finally { - $this->registry->unregister('isSecureArea', false); + foreach ($emails as $email) { + try { + $customer = $this->customerRepository->get($email); + $this->customerRepository->delete($customer); + } catch (NoSuchEntityException $e) { + // Customer does not exist + } } + $this->registry->unregister('isSecureArea', false); } /** From 036b0cf57558a55e5874ad1e60f58ec38b3ed050 Mon Sep 17 00:00:00 2001 From: Aakash Kumar Date: Sun, 15 Oct 2023 21:01:56 -0500 Subject: [PATCH 15/31] ACPT-1625: Add P2 Queries to GraphQlStateTest; -Add customer and checkout scenarios -Refactor -Update skiplist to remove duplicates --- .../App/GraphQlCheckoutMutationsStateTest.php | 73 +- .../App/GraphQlCustomerMutationsTest.php | 239 ++++- .../GraphQl/App/State/GraphQlStateDiff.php | 70 +- .../GraphQl/_files/state-skip-list.php | 936 +++--------------- 4 files changed, 467 insertions(+), 851 deletions(-) diff --git a/dev/tests/integration/testsuite/Magento/GraphQl/App/GraphQlCheckoutMutationsStateTest.php b/dev/tests/integration/testsuite/Magento/GraphQl/App/GraphQlCheckoutMutationsStateTest.php index 8e34b94a33816..44bf5ed881dc1 100644 --- a/dev/tests/integration/testsuite/Magento/GraphQl/App/GraphQlCheckoutMutationsStateTest.php +++ b/dev/tests/integration/testsuite/Magento/GraphQl/App/GraphQlCheckoutMutationsStateTest.php @@ -9,7 +9,6 @@ use Magento\Catalog\Api\ProductRepositoryInterface; use Magento\GraphQl\App\State\GraphQlStateDiff; -use Magento\GraphQl\Quote\GetMaskedQuoteIdByReservedOrderId; /** * Tests the dispatch method in the GraphQl Controller class using a simple product query @@ -41,12 +40,6 @@ protected function tearDown(): void parent::tearDown(); } - private function getCartIdHash(): string - { - $getMaskedQuoteIdByReservedOrderId = $this->graphQlStateDiff-> - getTestObjectManager()->get(GetMaskedQuoteIdByReservedOrderId::class); - return $getMaskedQuoteIdByReservedOrderId->execute('test_quote'); - } /** * @return void @@ -74,7 +67,7 @@ public function testCreateEmptyCart() : void */ public function testAddSimpleProductToCart() { - $cartId = $this->getCartIdHash(); + $cartId = $this->graphQlStateDiff->getCartIdHash('test_quote'); $query = $this->getAddProductToCartQuery(); $this->graphQlStateDiff->testState( $query, @@ -86,6 +79,31 @@ public function testAddSimpleProductToCart() $this ); } + + /** + * @magentoDataFixture Magento/GraphQl/Quote/_files/guest/create_empty_cart.php + * @magentoDataFixture Magento/GraphQl/Catalog/_files/simple_product.php + * @magentoDataFixture Magento/GraphQl/Quote/_files/add_simple_product.php + * @magentoDataFixture Magento/SalesRule/_files/coupon_code_with_wildcard.php + * @return void + * @throws \Exception + */ + public function testAddCouponToCart() + { + $cartId = $this->graphQlStateDiff->getCartIdHash('test_quote'); + $query = $this->getAddCouponToCartQuery(); + $this->graphQlStateDiff->testState( + $query, + ['cartId' => $cartId, 'couponCode' => '2?ds5!2d'], + [], + [], + 'applyCouponToCart', + '"data":{"applyCouponToCart":', + $this + ); + } + + /** * @magentoDataFixture Magento/GraphQl/Quote/_files/guest/create_empty_cart.php * @magentoDataFixture Magento/GraphQl/Catalog/_files/virtual_product.php @@ -94,7 +112,7 @@ public function testAddSimpleProductToCart() */ public function testAddVirtualProductToCart() { - $cartId = $this->getCartIdHash(); + $cartId = $this->graphQlStateDiff->getCartIdHash('test_quote'); $query = $this->getAddVirtualProductToCartQuery(); $this->graphQlStateDiff->testState( $query, @@ -114,7 +132,7 @@ public function testAddVirtualProductToCart() */ public function testAddBundleProductToCart() { - $cartId = $this->getCartIdHash(); + $cartId = $this->graphQlStateDiff->getCartIdHash('test_quote'); $query = $this->getAddBundleProductToCartQuery($cartId, 'bundle-product'); $this->graphQlStateDiff->testState( $query, @@ -134,7 +152,7 @@ public function testAddBundleProductToCart() */ public function testAddConfigurableProductToCart(): void { - $cartId = $this->getCartIdHash(); + $cartId = $this->graphQlStateDiff->getCartIdHash('test_quote'); $query = $this->getAddConfigurableProductToCartQuery(); $this->graphQlStateDiff->testState( $query, @@ -154,7 +172,7 @@ public function testAddConfigurableProductToCart(): void */ public function testAddDownloadableProductToCart(): void { - $cartId = $this->getCartIdHash(); + $cartId = $this->graphQlStateDiff->getCartIdHash('test_quote'); $sku = 'downloadable-product-with-purchased-separately-links'; $links = $this->getProductsLinks($sku); $linkId = key($links); @@ -178,7 +196,7 @@ public function testAddDownloadableProductToCart(): void */ public function testSetShippingAddressOnCart(): void { - $cartId = $this->getCartIdHash(); + $cartId = $this->graphQlStateDiff->getCartIdHash('test_quote'); $query = $this->getShippingAddressQuery(); $this->graphQlStateDiff->testState( $query, @@ -200,7 +218,7 @@ public function testSetShippingAddressOnCart(): void */ public function testSetBillingAddressOnCart(): void { - $cartId = $this->getCartIdHash(); + $cartId = $this->graphQlStateDiff->getCartIdHash('test_quote'); $query = $this->getBillingAddressQuery(); $this->graphQlStateDiff->testState( $query, @@ -223,7 +241,7 @@ public function testSetBillingAddressOnCart(): void */ public function testSetShippingMethodsOnCart(): void { - $cartId = $this->getCartIdHash(); + $cartId = $this->graphQlStateDiff->getCartIdHash('test_quote'); $query = $this->getShippingMethodsQuery(); $this->graphQlStateDiff->testState( $query, @@ -246,7 +264,7 @@ public function testSetShippingMethodsOnCart(): void */ public function testSetPaymentMethodOnCart(): void { - $cartId = $this->getCartIdHash(); + $cartId = $this->graphQlStateDiff->getCartIdHash('test_quote'); $query = $this->getPaymentMethodQuery(); $this->graphQlStateDiff->testState( $query, @@ -272,7 +290,7 @@ public function testSetPaymentMethodOnCart(): void */ public function testPlaceOrder(): void { - $cartId = $this->getCartIdHash(); + $cartId = $this->graphQlStateDiff->getCartIdHash('test_quote'); $query = $this->getPlaceOrderQuery(); $this->graphQlStateDiff->testState( $query, @@ -717,4 +735,25 @@ private function getPlaceOrderQuery(): string } QUERY; } + + private function getAddCouponToCartQuery(): string + { + return <<<'QUERY' + mutation($cartId: String!, $couponCode: String!) { + applyCouponToCart( + input: { + cart_id: $cartId + coupon_code: $couponCode + } + ) { + cart { + id + applied_coupons { + code + } + } + } + } + QUERY; + } } diff --git a/dev/tests/integration/testsuite/Magento/GraphQl/App/GraphQlCustomerMutationsTest.php b/dev/tests/integration/testsuite/Magento/GraphQl/App/GraphQlCustomerMutationsTest.php index d35eb808e39e6..d24cd88e0ebd0 100644 --- a/dev/tests/integration/testsuite/Magento/GraphQl/App/GraphQlCustomerMutationsTest.php +++ b/dev/tests/integration/testsuite/Magento/GraphQl/App/GraphQlCustomerMutationsTest.php @@ -8,6 +8,7 @@ namespace Magento\GraphQl\App; use Magento\Customer\Api\CustomerRepositoryInterface; +use Magento\Framework\Exception\LocalizedException; use Magento\Framework\Exception\NoSuchEntityException; use Magento\Framework\Registry; use Magento\GraphQl\App\State\GraphQlStateDiff; @@ -22,11 +23,7 @@ */ class GraphQlCustomerMutationsTest extends \PHPUnit\Framework\TestCase { - private CustomerRepositoryInterface $customerRepository; - - private Registry $registry; - - private GraphQlStateDiff $graphQlStateDiff; + private $graphQlStateDiff; /** * @inheritDoc @@ -73,21 +70,123 @@ public function testCustomerState( * @param array $emails * @return void */ - private function clearCustomerBeforeTest(array &$emails): void + private function clearCustomerBeforeTest(array $emails): void { - $this->customerRepository = $this->graphQlStateDiff->getTestObjectManager() + $customerRepository = $this->graphQlStateDiff->getTestObjectManager() ->get(CustomerRepositoryInterface::class); - $this->registry = $this->graphQlStateDiff->getTestObjectManager()->get(Registry::class); - $this->registry->register('isSecureArea', true); + $registry = $this->graphQlStateDiff->getTestObjectManager()->get(Registry::class); + $registry->register('isSecureArea', true); foreach ($emails as $email) { try { - $customer = $this->customerRepository->get($email); - $this->customerRepository->delete($customer); + $customer = $customerRepository->get($email); + $customerRepository->delete($customer); } catch (NoSuchEntityException $e) { // Customer does not exist } } - $this->registry->unregister('isSecureArea', false); + $registry->unregister('isSecureArea', false); + } + + /** + * @magentoDataFixture Magento/Checkout/_files/quote_with_virtual_product_saved.php + * @magentoDataFixture Magento/Customer/_files/customer.php + * @magentoDataFixture Magento/GraphQl/Catalog/_files/simple_product.php + * @magentoDataFixture Magento/GraphQl/Quote/_files/customer/create_empty_cart.php + * @magentoDataFixture Magento/GraphQl/Quote/_files/add_simple_product.php + */ + public function testMergeCarts(): void + { + $cartId1 = $this->graphQlStateDiff->getCartIdHash('test_order_with_virtual_product_without_address'); + $cartId2 = $this->graphQlStateDiff->getCartIdHash('test_quote'); + $query = $this->getCartMergeMutation(); + $this->graphQlStateDiff->testState( + $query, + ['cartId1' => $cartId1, 'cartId2' => $cartId2], + [], + ['email' => 'customer@example.com', 'password' => 'password'], + 'mergeCarts', + '"data":{"mergeCarts":', + $this + ); + } + + /** + * @magentoDataFixture Magento/Customer/_files/customer.php + * @return void + */ + public function testRequestPasswordResetEmail(): void + { + $query = $this->getRequestPasswordResetEmailMutation(); + $this->graphQlStateDiff->testState( + $query, + ['email' => 'customer@example.com'], + [], + [], + 'requestPasswordResetEmail', + '"data":{"requestPasswordResetEmail":', + $this + ); + } + + /** + * @magentoDataFixture Magento/Customer/_files/customer.php + * @return void + * @throws LocalizedException + * @throws NoSuchEntityException + */ + public function testResetPassword(): void + { + $query = $this->getResetPasswordMutation(); + $email = 'customer@example.com'; + $this->graphQlStateDiff->testState( + $query, + ['email' => $email, 'newPassword' => 'new_password123', 'resetPasswordToken' => $this->graphQlStateDiff->getResetPasswordToken($email)], + [], + [], + 'resetPassword', + '"data":{"resetPassword":', + $this + ); + + } + + /** + * @magentoDataFixture Magento/Customer/_files/customer.php + * @return void + * @throws LocalizedException + * @throws NoSuchEntityException + */ + public function testChangePassword(): void + { + $query = $this->getChangePasswordMutation(); + $this->graphQlStateDiff->testState( + $query, + ['currentPassword' => 'password', 'newPassword' => 'new_password123'], + ['currentPassword' => 'new_password123', 'newPassword' => 'password_new123'], + [['email'=>'customer@example.com', 'password' => 'password'], + ['email'=>'customer@example.com', 'password' => 'new_password123']], + 'changeCustomerPassword', + '"data":{"changeCustomerPassword":', + $this + ); + } + + /** + * @magentoDataFixture Magento/Customer/_files/customer_without_addresses.php + * @return void + */ + public function testCreateCustomerAddress(): void + { + $query = $this->getCreateCustomerAddressMutation(); + $this->graphQlStateDiff->testState( + $query, + [], + [], + ['email' => 'customer@example.com', 'password' => 'password'], + 'createCustomerAddress', + '"data":{"createCustomerAddress":', + $this + ); } /** @@ -287,4 +386,120 @@ public function customerDataProvider(): array ], ]; } + + private function getCartMergeMutation(): string + { + return <<<'QUERY' + mutation($cartId1: String!, $cartId2: String!) { + mergeCarts( + source_cart_id: $cartId1 + destination_cart_id: $cartId2 + ) { + items { + quantity + product { + sku + } + } + } + } +QUERY; + + } + + private function getRequestPasswordResetEmailMutation(): string + { + return <<<'QUERY' + mutation($email: String!) { + requestPasswordResetEmail(email: $email) + } + QUERY; + + } + + private function getResetPasswordMutation() + { + return <<<'QUERY' + mutation($email: String!, $newPassword: String!, $resetPasswordToken: String!) { + resetPassword( + email: $email + resetPasswordToken: $resetPasswordToken + newPassword: $newPassword + ) + } + QUERY; + } + + private function getChangePasswordMutation() + { + return <<<'QUERY' + mutation($currentPassword: String!, $newPassword: String!) { + changeCustomerPassword( + currentPassword: $currentPassword + newPassword: $newPassword + ) { + id + email + firstname + lastname + } + } + QUERY; + + } + + private function getCreateCustomerAddressMutation(): string + { + return <<<'QUERY' + mutation { + createCustomerAddress( + input: { + region: { + region: "Alberta" + region_id: 66 + region_code: "AB" + } + country_code: CA + street: ["Line 1 Street","Line 2"] + company: "Company Name" + telephone: "123456789" + fax: "123123123" + postcode: "7777" + city: "New York" + firstname: "Adam" + lastname: "Phillis" + middlename: "A" + prefix: "Mr." + suffix: "Jr." + vat_id: "1" + default_shipping: true + default_billing: true + } + ) { + id + customer_id + region { + region + region_id + region_code + } + country_code + street + company + telephone + fax + postcode + city + firstname + lastname + middlename + prefix + suffix + vat_id + default_shipping + default_billing + } + } + QUERY; + } } diff --git a/dev/tests/integration/testsuite/Magento/GraphQl/App/State/GraphQlStateDiff.php b/dev/tests/integration/testsuite/Magento/GraphQl/App/State/GraphQlStateDiff.php index f6e1245399f63..0924910d8747e 100644 --- a/dev/tests/integration/testsuite/Magento/GraphQl/App/State/GraphQlStateDiff.php +++ b/dev/tests/integration/testsuite/Magento/GraphQl/App/State/GraphQlStateDiff.php @@ -7,11 +7,17 @@ namespace Magento\GraphQl\App\State; +use Magento\Customer\Api\AccountManagementInterface; +use Magento\Customer\Model\AccountManagement; +use Magento\Customer\Model\CustomerRegistry; use Magento\Framework\App\Http as HttpApp; use Magento\Framework\App\ObjectManager as AppObjectManager; use Magento\Framework\App\Request\HttpFactory as RequestFactory; use Magento\Framework\App\Response\Http as HttpResponse; +use Magento\Framework\Exception\LocalizedException; +use Magento\Framework\Exception\NoSuchEntityException; use Magento\Framework\ObjectManagerInterface; +use Magento\GraphQl\Quote\GetMaskedQuoteIdByReservedOrderId; use Magento\Integration\Api\CustomerTokenServiceInterface; use Magento\Quote\Model\MaskedQuoteIdToQuoteIdInterface; use Magento\TestFramework\Helper\Bootstrap; @@ -86,9 +92,19 @@ public function testState( ]); $output1 = $this->request($jsonEncodedRequest, $operationName, $authInfo1, $test,true); $test->assertStringContainsString($expected, $output1); - if ($operationName === 'placeOrder') { - $this->reactivateCart($variables); + if ($operationName === 'placeOrder' || $operationName === 'mergeCarts') { + foreach($variables as $cartId) { + $this->reactivateCart($cartId); + } } + elseif ($operationName==='applyCouponToCart') { + $this->removeCouponFromCart($variables); + } elseif ($operationName==='resetPassword') { + $variables2['resetPasswordToken'] = $this->getResetPasswordToken($variables['email']); + $variables2['email'] = $variables['email']; + $variables2['newPassword'] = $variables['newPassword']; + } + if ($variables2) { $jsonEncodedRequest = json_encode([ 'query' => $query, @@ -108,7 +124,7 @@ public function testState( * @return array * @throws \Exception */ - public function request(string $query, string $operationName, array $authInfo, TestCase $test, bool $firstRequest = false): string + private function request(string $query, string $operationName, array $authInfo, TestCase $test, bool $firstRequest = false): string { $this->objectManagerForTest->resetStateSharedInstances(); $this->comparator->rememberObjectsStateBefore($firstRequest); @@ -169,14 +185,54 @@ private function doRequest(string $query, array $authInfo) * @param array $variables * @return void */ - private function reactivateCart(array $variables) + private function reactivateCart(string $cartId) { - $maskedQuoteIdToQuoteId = - $this->objectManagerForTest->get(MaskedQuoteIdToQuoteIdInterface::class); + $cartId = $this->getCartId($cartId); $cart = $this->objectManagerForTest->get(\Magento\Quote\Model\Quote::class); - $cartId = $maskedQuoteIdToQuoteId->execute($variables['cartId']); $cart->load($cartId); $cart->setIsActive(true); $cart->save(); } + + private function removeCouponFromCart(array $variables) + { + $couponManagement = $this->objectManagerForTest->get(\Magento\Quote\Api\CouponManagementInterface::class); + $cartId = $this->getCartId($variables['cartId']); + $couponManagement->remove($cartId); + } + + private function getCartId(string $cartId) + { + $maskedQuoteIdToQuoteId = $this->objectManagerForTest->get(MaskedQuoteIdToQuoteIdInterface::class); + return $maskedQuoteIdToQuoteId->execute($cartId); + } + + public function getCartIdHash(string $cartId): string + { + $getMaskedQuoteIdByReservedOrderId = $this->getTestObjectManager() + ->get(GetMaskedQuoteIdByReservedOrderId::class); + return $getMaskedQuoteIdByReservedOrderId->execute($cartId); + } + + /** + * Get reset password token + * + * @return string + * + * @throws LocalizedException + * @throws NoSuchEntityException + */ + public function getResetPasswordToken(string $email): string + { + $accountManagement = $this->objectManagerForTest->get(AccountManagementInterface::class); + $customerRegistry = $this->objectManagerForTest->get(CustomerRegistry::class); + $accountManagement->initiatePasswordReset( + $email, + AccountManagement::EMAIL_RESET, + 1 + ); + + $customerSecure = $customerRegistry->retrieveSecureData(1); + return $customerSecure->getRpToken(); + } } diff --git a/dev/tests/integration/testsuite/Magento/GraphQl/_files/state-skip-list.php b/dev/tests/integration/testsuite/Magento/GraphQl/_files/state-skip-list.php index dd40634748fb9..f7b34f077c89a 100644 --- a/dev/tests/integration/testsuite/Magento/GraphQl/_files/state-skip-list.php +++ b/dev/tests/integration/testsuite/Magento/GraphQl/_files/state-skip-list.php @@ -9,16 +9,10 @@ return [ 'navigationMenu' => [ Magento\CatalogGraphQl\Model\Resolver\Products\DataProvider\ExtractDataFromCategoryTree::class => null, - Magento\Customer\Model\Session::class => null, Magento\Framework\GraphQl\Query\Fields::class => null, - Magento\Framework\Session\Generic::class => null, - Magento\Framework\Module\ModuleList::class => null, - Magento\Framework\Module\Manager::class => null, ], 'productDetailByName' => [ - Magento\Customer\Model\Session::class => null, Magento\Framework\GraphQl\Query\Fields::class => null, - Magento\Framework\Session\Generic::class => null, Magento\Store\Model\GroupRepository::class => null, ], 'category' => [ @@ -29,18 +23,12 @@ Magento\Framework\GraphQl\Query\Fields::class => null, ], 'products' => [ - Magento\Catalog\Model\Config::class => null, Magento\Catalog\Model\Category\Attribute\Source\Sortby::class => null, - Magento\CatalogInventory\Model\StockRegistryProvider::class => null, - Magento\CatalogInventory\Model\StockRegistry::class => null, ], 'resolveUrl' => [ Magento\Framework\GraphQl\Query\Fields::class => null, ], 'createEmptyCart' => [ - Magento\Quote\Model\Quote\Address\Interceptor::class => null, - Magento\GraphQlNewRelic\Plugin\ReportError::class => null, - Magento\Customer\Model\ResourceModel\Attribute::class => null, Magento\Eav\Api\Data\AttributeExtensionFactory::class => null, Magento\Eav\Model\Entity\Attribute\FrontendLabelFactory::class => null, Magento\Eav\Model\Validator\Attribute\Code::class => null, @@ -50,467 +38,32 @@ Magento\Company\Model\Company::class => null, Magento\Company\Model\Company\ReservedAttributeList::class => null, Magento\Eav\Model\ReservedAttributeChecker::class => null, - Magento\GraphQlNewRelic\Plugin\ReportError::class => null - - ], - 'addSimpleProductsToCart' => [ - Magento\Quote\Model\Quote\Item\Interceptor::class => null, - Magento\Framework\Stdlib\ArrayManager::class => null, - Magento\Config\Model\Config\Processor\EnvironmentPlaceholder::class => null, - Magento\Quote\Model\ResourceModel\Quote::class => null, - Magento\Quote\Model\QuoteIdToMaskedQuoteId::class => null, - Magento\GraphQl\Quote\GetMaskedQuoteIdByReservedOrderId::class => null, - Magento\Framework\Reflection\MethodsMap::class => null, - Magento\Framework\Reflection\DataObjectProcessor::class => null, - Magento\Catalog\Model\ResourceModel\Product::class => null, - Magento\Framework\Api\DataObjectHelper::class => null, - Magento\Catalog\Model\ProductRepository::class => null, - Magento\CatalogInventory\Model\StockRegistryProvider::class => null, - Magento\CatalogInventory\Model\StockRegistry::class => null, - Magento\Framework\Translate\Inline::class => null, - Magento\Framework\Json\Encoder::class => null, - Magento\Customer\Model\ResourceModel\Customer::class => null, - Magento\Customer\Model\ResourceModel\CustomerRepository::class => null, - Laminas\Uri\Uri::class => null, - Magento\Customer\Model\Session\Validators\CutoffValidator::class => null, - Magento\Customer\Model\Customer::class => null, - Magento\Customer\Model\Session\SessionCleaner::class => null, - Magento\Tax\Model\Calculation::class => null, - Magento\Tax\Model\TaxCalculation::class => null, - Magento\SalesRule\Model\RulesApplier::class => null, - Magento\OfflineShipping\Model\SalesRule\Calculator::class => null, - Magento\OfflineShipping\Model\Quote\Address\FreeShipping::class => null, - Magento\SalesRule\Model\Validator::class => null, - Magento\Quote\Model\Quote\Address\Total\Collector::class => null, - Magento\Quote\Model\Quote\TotalsCollectorList::class => null, - Magento\Quote\Model\Quote\TotalsCollector::class => null, - Magento\User\Helper\Data::class => null, - Magento\Authorization\Model\RoleFactory::class => null, - Magento\User\Model\UserValidationRules::class => null, - Magento\Framework\Acl\Data\Cache::class => null, - Magento\User\Model\Backend\Config\ObserverConfig::class => null, - Magento\User\Model\ResourceModel\User::class => null, - Magento\User\Model\Notificator::class => null, - Magento\TestModuleCatalogInventoryCache\Plugin\PreventCachingPreloadedStockDataInToStockRegistry::class => null, - Magento\Quote\Model\Quote\ProductOptionFactory::class => null, - Magento\Quote\Api\Data\ProductOptionExtensionFactory::class => null, - Magento\Catalog\Model\CustomOptions\CustomOptionProcessor::class => null, - Magento\InventorySalesAsyncOrder\Model\ReservationExecution::class => null, - 'orderMetadata' => null, - Magento\Sales\Api\Data\OrderSearchResultInterfaceFactory::class => null, - Magento\Sales\Api\Data\OrderExtensionFactory::class => null, - Magento\Payment\Api\Data\PaymentAdditionalInfoInterfaceFactory::class => null, - Magento\Sales\Model\OrderRepository::class => null, - Magento\InventorySalesAsyncOrder\Plugin\SkipAsyncOrderCheckDataWithNoDeferredStockUpdatePlugin::class => null, - Magento\InventoryInStorePickup\Model\ExtractPickupLocationAddressData::class => null, - Magento\InventoryInStorePickupQuote\Model\ExtractQuoteAddressShippingAddressData::class => null, - Magento\InventoryInStorePickupQuote\Model\GetShippingAddressData::class => null, - Magento\InventoryInStorePickupQuote\Model\IsPickupLocationShippingAddress::class => null, - Magento\InventoryInStorePickupQuote\Model\ToQuoteAddress::class => null, - Magento\InventoryInStorePickupQuote\Model\GetWebsiteCodeByStoreId::class => null, - Magento\InventoryInStorePickupQuote\Plugin\Quote\ReplaceShippingAddressForShippingAddressManagement::class => null, - Magento\CustomerCustomAttributes\Model\ResourceModel\Sales\Quote::class => null, - Magento\Customer\Model\ResourceModel\Attribute::class => null, - Magento\GraphQlNewRelic\Plugin\ReportError::class => null, - Magento\NegotiableQuote\Model\Plugin\Quote\Model\ShippingAssignmentPersisterPlugin::class => null, - Magento\PurchaseOrder\Plugin\Quote\Model\QuoteRepositoryPlugin::class => null, - Magento\Customer\Model\ResourceModel\Attribute::class => null, - Magento\GraphQlNewRelic\Plugin\ReportError::class => null, - ], - 'addVirtualProductsToCart' => [ - Magento\Framework\Stdlib\ArrayManager::class => null, - Magento\Quote\Model\Quote\Item\Interceptor::class => null, - Magento\Config\Model\Config\Processor\EnvironmentPlaceholder::class => null, - Magento\Quote\Model\ResourceModel\Quote::class => null, - Magento\Quote\Model\QuoteIdToMaskedQuoteId::class => null, - Magento\GraphQl\Quote\GetMaskedQuoteIdByReservedOrderId::class => null, - Magento\Framework\Reflection\MethodsMap::class => null, - Magento\Framework\Reflection\DataObjectProcessor::class => null, - Magento\Framework\Api\DataObjectHelper::class => null, - Magento\Catalog\Model\ResourceModel\Product::class => null, - Magento\Catalog\Model\ProductRepository::class => null, - Magento\CatalogInventory\Model\StockRegistryProvider::class => null, - Magento\CatalogInventory\Model\StockRegistry::class => null, - Magento\Framework\Translate\Inline::class => null, - Magento\Framework\Json\Encoder::class => null, - Magento\Customer\Model\ResourceModel\Customer::class => null, - Magento\Customer\Model\ResourceModel\CustomerRepository::class => null, - Laminas\Uri\Uri::class => null, - Magento\Customer\Model\Session\Validators\CutoffValidator::class => null, - Magento\Customer\Model\Customer::class => null, - Magento\Customer\Model\Session\SessionCleaner::class => null, - Magento\Tax\Model\Calculation::class => null, - Magento\Tax\Model\TaxCalculation::class => null, - Magento\SalesRule\Model\RulesApplier::class => null, - Magento\OfflineShipping\Model\SalesRule\Calculator::class => null, - Magento\OfflineShipping\Model\Quote\Address\FreeShipping::class => null, - Magento\SalesRule\Model\Validator::class => null, - Magento\Quote\Model\Quote\Address\Total\Collector::class => null, - Magento\Quote\Model\Quote\TotalsCollectorList::class => null, - Magento\Quote\Model\Quote\TotalsCollector::class => null, - Magento\CustomerCustomAttributes\Model\ResourceModel\Sales\Quote::class => null, - Magento\User\Helper\Data::class => null, - Magento\Authorization\Model\RoleFactory::class => null, - Magento\User\Model\UserValidationRules::class => null, - Magento\Framework\Acl\Data\Cache::class => null, - Magento\User\Model\Backend\Config\ObserverConfig::class => null, - Magento\User\Model\ResourceModel\User::class => null, - Magento\User\Model\Notificator::class => null, - Magento\TestModuleCatalogInventoryCache\Plugin\PreventCachingPreloadedStockDataInToStockRegistry::class => null, - Magento\Quote\Model\Quote\ProductOptionFactory::class => null, - Magento\Quote\Api\Data\ProductOptionExtensionFactory::class => null, - Magento\Catalog\Model\CustomOptions\CustomOptionProcessor::class => null, - Magento\InventorySalesAsyncOrder\Model\ReservationExecution::class => null, - 'orderMetadata' => null, - Magento\Sales\Api\Data\OrderSearchResultInterfaceFactory::class => null, - Magento\Sales\Api\Data\OrderExtensionFactory::class => null, - Magento\Payment\Api\Data\PaymentAdditionalInfoInterfaceFactory::class => null, - Magento\Sales\Model\OrderRepository::class => null, - Magento\InventorySalesAsyncOrder\Plugin\SkipAsyncOrderCheckDataWithNoDeferredStockUpdatePlugin::class => null, - Magento\Customer\Model\ResourceModel\Attribute::class => null, - Magento\GraphQlNewRelic\Plugin\ReportError::class => null, ], 'addBundleProductsToCart' => [ - Magento\Catalog\Model\Config::class => null, - Magento\Framework\Stdlib\ArrayManager::class => null, - Magento\Config\Model\Config\Processor\EnvironmentPlaceholder::class => null, - Magento\Quote\Model\ResourceModel\Quote::class => null, - Magento\Quote\Model\QuoteIdToMaskedQuoteId::class => null, - Magento\GraphQl\Quote\GetMaskedQuoteIdByReservedOrderId::class => null, - Magento\Framework\Reflection\MethodsMap::class => null, - Magento\Framework\Reflection\DataObjectProcessor::class => null, - Magento\Framework\Api\DataObjectHelper::class => null, - Magento\Framework\Translate\Inline::class => null, - Magento\Framework\Json\Encoder::class => null, - Magento\Customer\Model\ResourceModel\Customer::class => null, - Magento\Customer\Model\ResourceModel\CustomerRepository::class => null, - Laminas\Uri\Uri::class => null, - Magento\Customer\Model\Session\Validators\CutoffValidator::class => null, - Magento\Customer\Model\Customer::class => null, - Magento\Customer\Model\Session\SessionCleaner::class => null, - Magento\Tax\Model\Calculation::class => null, - Magento\Tax\Model\TaxCalculation::class => null, - Magento\SalesRule\Model\RulesApplier::class => null, - Magento\OfflineShipping\Model\SalesRule\Calculator::class => null, - Magento\OfflineShipping\Model\Quote\Address\FreeShipping::class => null, - Magento\SalesRule\Model\Validator::class => null, - Magento\Quote\Model\Quote\Address\Total\Collector::class => null, - Magento\Quote\Model\Quote\TotalsCollectorList::class => null, - Magento\Quote\Model\Quote\TotalsCollector::class => null, - Magento\Downloadable\Model\Url\DomainValidator::class => null, - Magento\User\Helper\Data::class => null, - Magento\Authorization\Model\RoleFactory::class => null, - Magento\User\Model\UserValidationRules::class => null, - Magento\Framework\Acl\Data\Cache::class => null, - Magento\User\Model\Backend\Config\ObserverConfig::class => null, - Magento\User\Model\ResourceModel\User::class => null, - Magento\User\Model\Notificator::class => null, - Magento\TestModuleCatalogInventoryCache\Plugin\PreventCachingPreloadedStockDataInToStockRegistry::class => null, - Magento\Quote\Api\Data\ProductOptionExtensionFactory::class => null, Magento\Quote\Api\Data\ProductOptionInterfaceFactory::class => null, Magento\Bundle\Model\CartItemProcessor::class => null, - Magento\Quote\Model\Quote\ProductOptionFactory::class => null, - Magento\Catalog\Model\CustomOptions\CustomOptionProcessor::class => null, - Magento\Quote\Model\Quote\Item\Interceptor::class => null, - Magento\Staging\Model\VersionManager::class => null, - Magento\Staging\Model\Url\BaseUrlModifier::class => null, - Magento\Staging\Model\Event\Manager::class => null, - Magento\CustomerCustomAttributes\Model\ResourceModel\Sales\Quote::class => null, - Magento\CatalogStaging\Plugin\Catalog\Model\Indexer\AbstractFlatState::class => null, - Magento\InventorySalesAsyncOrder\Model\ReservationExecution::class => null, - 'orderMetadata' => null, - Magento\Sales\Api\Data\OrderSearchResultInterfaceFactory::class => null, - Magento\Sales\Api\Data\OrderExtensionFactory::class => null, - Magento\Payment\Api\Data\PaymentAdditionalInfoInterfaceFactory::class => null, - Magento\Sales\Model\OrderRepository::class => null, - Magento\InventorySalesAsyncOrder\Plugin\SkipAsyncOrderCheckDataWithNoDeferredStockUpdatePlugin::class => null, - Magento\InventoryInStorePickup\Model\ExtractPickupLocationAddressData::class => null, - Magento\InventoryInStorePickupQuote\Model\ExtractQuoteAddressShippingAddressData::class => null, - Magento\InventoryInStorePickupQuote\Model\GetShippingAddressData::class => null, - Magento\InventoryInStorePickupQuote\Model\IsPickupLocationShippingAddress::class => null, - Magento\InventoryInStorePickupQuote\Model\ToQuoteAddress::class => null, - Magento\InventoryInStorePickupQuote\Model\GetWebsiteCodeByStoreId::class => null, - Magento\InventoryInStorePickupQuote\Plugin\Quote\ReplaceShippingAddressForShippingAddressManagement::class => null, - Magento\NegotiableQuote\Model\Plugin\Quote\Model\ShippingAssignmentPersisterPlugin::class => null, - Magento\PurchaseOrder\Plugin\Quote\Model\QuoteRepositoryPlugin::class => null, - Magento\Customer\Model\ResourceModel\Attribute::class => null, - Magento\GraphQlNewRelic\Plugin\ReportError::class => null, ], - 'addConfigurableProductsToCart' => [ - Magento\Quote\Model\Quote\Item\Interceptor::class => null, - Magento\Framework\Stdlib\ArrayManager::class => null, - Magento\Config\Model\Config\Processor\EnvironmentPlaceholder::class => null, - Magento\Quote\Model\ResourceModel\Quote::class => null, - Magento\Quote\Model\QuoteIdToMaskedQuoteId::class => null, - Magento\GraphQl\Quote\GetMaskedQuoteIdByReservedOrderId::class => null, - Magento\Framework\Reflection\MethodsMap::class => null, - Magento\Framework\Reflection\DataObjectProcessor::class => null, - Magento\Catalog\Model\ResourceModel\Product::class => null, - Magento\Framework\Api\DataObjectHelper::class => null, - Magento\Catalog\Model\ProductRepository::class => null, - Magento\CatalogInventory\Model\StockRegistryProvider::class => null, - Magento\CatalogInventory\Model\StockRegistry::class => null, - Magento\Framework\Translate\Inline::class => null, - Magento\Framework\Json\Encoder::class => null, - Magento\Customer\Model\ResourceModel\Customer::class => null, - Magento\Customer\Model\ResourceModel\CustomerRepository::class => null, - Laminas\Uri\Uri::class => null, - Magento\Customer\Model\Session\Validators\CutoffValidator::class => null, - Magento\Customer\Model\Customer::class => null, - Magento\Customer\Model\Session\SessionCleaner::class => null, - Magento\Tax\Model\Calculation::class => null, - Magento\Tax\Model\TaxCalculation::class => null, - Magento\SalesRule\Model\RulesApplier::class => null, - Magento\OfflineShipping\Model\SalesRule\Calculator::class => null, - Magento\OfflineShipping\Model\Quote\Address\FreeShipping::class => null, - Magento\SalesRule\Model\Validator::class => null, - Magento\Quote\Model\Quote\Address\Total\Collector::class => null, - Magento\Quote\Model\Quote\TotalsCollectorList::class => null, - Magento\Quote\Model\Quote\TotalsCollector::class => null, - Magento\User\Helper\Data::class => null, - Magento\Authorization\Model\RoleFactory::class => null, - Magento\User\Model\UserValidationRules::class => null, - Magento\Framework\Acl\Data\Cache::class => null, - Magento\User\Model\Backend\Config\ObserverConfig::class => null, - Magento\User\Model\ResourceModel\User::class => null, - Magento\User\Model\Notificator::class => null, - Magento\TestModuleCatalogInventoryCache\Plugin\PreventCachingPreloadedStockDataInToStockRegistry::class => null, - Magento\Eav\Plugin\Model\ResourceModel\Entity\Attribute::class => null, - Magento\Quote\Model\Quote\ProductOptionFactory::class => null, - Magento\Quote\Api\Data\ProductOptionExtensionFactory::class => null, - Magento\ConfigurableProduct\Model\Quote\Item\CartItemProcessor::class => null, - Magento\Catalog\Model\CustomOptions\CustomOptionProcessor::class => null, - Magento\InventorySalesAsyncOrder\Model\ReservationExecution::class => null, - 'orderMetadata' => null, - Magento\Sales\Api\Data\OrderSearchResultInterfaceFactory::class => null, - Magento\Sales\Api\Data\OrderExtensionFactory::class => null, - Magento\Payment\Api\Data\PaymentAdditionalInfoInterfaceFactory::class => null, - Magento\Sales\Model\OrderRepository::class => null, - Magento\InventorySalesAsyncOrder\Plugin\SkipAsyncOrderCheckDataWithNoDeferredStockUpdatePlugin::class => null, - Magento\InventoryInStorePickup\Model\ExtractPickupLocationAddressData::class => null, - Magento\InventoryInStorePickupQuote\Model\ExtractQuoteAddressShippingAddressData::class => null, - Magento\InventoryInStorePickupQuote\Model\GetShippingAddressData::class => null, - Magento\InventoryInStorePickupQuote\Model\IsPickupLocationShippingAddress::class => null, - Magento\InventoryInStorePickupQuote\Model\ToQuoteAddress::class => null, - Magento\InventoryInStorePickupQuote\Model\GetWebsiteCodeByStoreId::class => null, - Magento\InventoryInStorePickupQuote\Plugin\Quote\ReplaceShippingAddressForShippingAddressManagement::class => null, - Magento\CustomerCustomAttributes\Model\ResourceModel\Sales\Quote::class => null, - Magento\NegotiableQuote\Model\Plugin\Quote\Model\ShippingAssignmentPersisterPlugin::class => null, - Magento\PurchaseOrder\Plugin\Quote\Model\QuoteRepositoryPlugin::class => null, - Magento\GraphQlNewRelic\Plugin\ReportError::class => null, - - ], - 'addDownloadableProductsToCart' => [ - Magento\Quote\Model\Quote\Item\Interceptor::class => null, - Magento\Framework\Stdlib\ArrayManager::class => null, - Magento\Config\Model\Config\Processor\EnvironmentPlaceholder::class => null, - Magento\Quote\Model\ResourceModel\Quote::class => null, - Magento\Quote\Model\QuoteIdToMaskedQuoteId::class => null, - Magento\GraphQl\Quote\GetMaskedQuoteIdByReservedOrderId::class => null, - Magento\Framework\Reflection\MethodsMap::class => null, - Magento\Framework\Reflection\DataObjectProcessor::class => null, - Magento\Framework\Api\DataObjectHelper::class => null, - Magento\Framework\Translate\Inline::class => null, - Magento\Framework\Json\Encoder::class => null, - Magento\Customer\Model\ResourceModel\Customer::class => null, - Magento\Customer\Model\ResourceModel\CustomerRepository::class => null, - Laminas\Uri\Uri::class => null, - Magento\Customer\Model\Session\Validators\CutoffValidator::class => null, - Magento\Customer\Model\Customer::class => null, - Magento\Customer\Model\Session\SessionCleaner::class => null, - Magento\Tax\Model\Calculation::class => null, - Magento\Tax\Model\TaxCalculation::class => null, - Magento\SalesRule\Model\RulesApplier::class => null, - Magento\OfflineShipping\Model\SalesRule\Calculator::class => null, - Magento\OfflineShipping\Model\Quote\Address\FreeShipping::class => null, - Magento\SalesRule\Model\Validator::class => null, - Magento\Quote\Model\Quote\Address\Total\Collector::class => null, - Magento\Quote\Model\Quote\TotalsCollectorList::class => null, - Magento\Quote\Model\Quote\TotalsCollector::class => null, - Magento\Downloadable\Model\Url\DomainValidator::class => null, - Magento\Framework\Url\QueryParamsResolver::class => null, - Magento\User\Helper\Data::class => null, - Magento\Authorization\Model\RoleFactory::class => null, - Magento\User\Model\UserValidationRules::class => null, - Magento\Framework\Acl\Data\Cache::class => null, - Magento\User\Model\Backend\Config\ObserverConfig::class => null, - Magento\User\Model\ResourceModel\User::class => null, - Magento\User\Model\Notificator::class => null, - Magento\TestModuleCatalogInventoryCache\Plugin\PreventCachingPreloadedStockDataInToStockRegistry::class => null, - Magento\Quote\Model\Quote\ProductOptionFactory::class => null, - Magento\Quote\Api\Data\ProductOptionExtensionFactory::class => null, - Magento\Downloadable\Model\Quote\Item\CartItemProcessor::class => null, - Magento\Catalog\Model\CustomOptions\CustomOptionProcessor::class => null, - Magento\Staging\Model\VersionManager::class => null, - Magento\Staging\Model\Url\BaseUrlModifier::class => null, - Magento\Staging\Model\Event\Manager::class => null, - Magento\CustomerCustomAttributes\Model\ResourceModel\Sales\Quote::class => null, - Magento\CatalogStaging\Plugin\Catalog\Model\Indexer\AbstractFlatState::class => null, - Magento\InventorySalesAsyncOrder\Model\ReservationExecution::class => null, - 'orderMetadata' => null, - Magento\Sales\Api\Data\OrderSearchResultInterfaceFactory::class => null, - Magento\Sales\Api\Data\OrderExtensionFactory::class => null, - Magento\Payment\Api\Data\PaymentAdditionalInfoInterfaceFactory::class => null, - Magento\Sales\Model\OrderRepository::class => null, - Magento\InventorySalesAsyncOrder\Plugin\SkipAsyncOrderCheckDataWithNoDeferredStockUpdatePlugin::class => null, - Magento\Customer\Model\ResourceModel\Attribute::class => null, - Magento\GraphQlNewRelic\Plugin\ReportError::class => null, - ], - 'setShippingAddressesOnCart' => [ - setShippingAddressesOnCart::class => null, - Magento\Framework\Reflection\DataObjectProcessor::class => null, - Magento\Framework\Api\DataObjectHelper::class => null, - Magento\Framework\Translate\Inline::class => null, - Magento\Framework\Json\Encoder::class => null, - Magento\Directory\Helper\Data::class => null, - Magento\Customer\Model\ResourceModel\AddressRepository::class => null, - Magento\Customer\Model\ResourceModel\Customer::class => null, - Magento\Customer\Model\ResourceModel\CustomerRepository::class => null, - Laminas\Uri\Uri::class => null, - Magento\Customer\Model\Session\Validators\CutoffValidator::class => null, - Magento\Customer\Model\Customer::class => null, - Magento\Customer\Model\Session\SessionCleaner::class => null, - Magento\Tax\Model\Calculation::class => null, - Magento\Tax\Model\TaxCalculation::class => null, - Magento\SalesRule\Model\RulesApplier::class => null, - Magento\OfflineShipping\Model\SalesRule\Calculator::class => null, - Magento\OfflineShipping\Model\Quote\Address\FreeShipping::class => null, - Magento\SalesRule\Model\Validator::class => null, - Magento\Quote\Model\Quote\Address\Total\Collector::class => null, - Magento\Quote\Model\Quote\TotalsCollectorList::class => null, - Magento\Quote\Model\Quote\TotalsCollector::class => null, - Magento\Framework\Reflection\MethodsMap::class => null, - Magento\GraphQlNewRelic\Plugin\ReportError::class => null, - ], - 'setBillingAddressOnCart' => [ - Magento\Quote\Model\Quote\Address\Interceptor::class => null, - Magento\Framework\Reflection\MethodsMap::class => null, - Magento\Framework\Reflection\DataObjectProcessor::class => null, - Magento\Framework\Api\DataObjectHelper::class => null, - Magento\Framework\Translate\Inline::class => null, - Magento\Framework\Json\Encoder::class => null, - Magento\Directory\Helper\Data::class => null, - Magento\Customer\Model\ResourceModel\AddressRepository::class => null, - Magento\Customer\Model\ResourceModel\Customer::class => null, - Magento\Customer\Model\ResourceModel\CustomerRepository::class => null, - Laminas\Uri\Uri::class => null, - Magento\Customer\Model\Session\Validators\CutoffValidator::class => null, - Magento\Customer\Model\Customer::class => null, - Magento\Customer\Model\Session\SessionCleaner::class => null, - Magento\Tax\Model\Calculation::class => null, - Magento\Tax\Model\TaxCalculation::class => null, - Magento\SalesRule\Model\RulesApplier::class => null, - Magento\OfflineShipping\Model\SalesRule\Calculator::class => null, - Magento\OfflineShipping\Model\Quote\Address\FreeShipping::class => null, - Magento\SalesRule\Model\Validator::class => null, - Magento\Quote\Model\Quote\Address\Total\Collector::class => null, - Magento\Quote\Model\Quote\TotalsCollectorList::class => null, - Magento\Quote\Model\Quote\TotalsCollector::class => null, - Magento\GraphQlNewRelic\Plugin\ReportError::class => null, - ], - 'setShippingMethodsOnCart' => [ - Magento\Quote\Model\ResourceModel\Quote::class => null, - Magento\Quote\Model\QuoteIdToMaskedQuoteId::class => null, - Magento\GraphQl\Quote\GetMaskedQuoteIdByReservedOrderId::class => null, - Magento\Framework\Reflection\MethodsMap::class => null, - Magento\Framework\Reflection\DataObjectProcessor::class => null, - Magento\Framework\Api\DataObjectHelper::class => null, - Magento\Framework\Translate\Inline::class => null, - Magento\Framework\Json\Encoder::class => null, - Magento\Customer\Model\ResourceModel\Customer::class => null, - Magento\Customer\Model\ResourceModel\CustomerRepository::class => null, - Laminas\Uri\Uri::class => null, - Magento\Customer\Model\Session\Validators\CutoffValidator::class => null, - Magento\Customer\Model\Customer::class => null, - Magento\Customer\Model\Session\SessionCleaner::class => null, - Magento\Tax\Model\Calculation::class => null, - Magento\Tax\Model\TaxCalculation::class => null, - Magento\SalesRule\Model\RulesApplier::class => null, - Magento\OfflineShipping\Model\SalesRule\Calculator::class => null, - Magento\OfflineShipping\Model\Quote\Address\FreeShipping::class => null, - Magento\SalesRule\Model\Validator::class => null, - Magento\Quote\Model\Quote\Address\Total\Collector::class => null, - Magento\Quote\Model\Quote\TotalsCollectorList::class => null, - Magento\Quote\Model\Quote\TotalsCollector::class => null, - Magento\Payment\Gateway\Config\ConfigFactory::class => null, - Magento\Payment\Gateway\Data\Quote\AddressAdapterFactory::class => null, - Magento\CustomerCustomAttributes\Model\ResourceModel\Sales\Quote::class => null, - Magento\Customer\Model\ResourceModel\Attribute::class => null, - Magento\GraphQlNewRelic\Plugin\ReportError::class => null, - ], - 'setPaymentMethodOnCart' => [ - Magento\Framework\Stdlib\ArrayManager::class => null, - Magento\Config\Model\Config\Processor\EnvironmentPlaceholder::class => null, - Magento\Framework\Reflection\MethodsMap::class => null, - Magento\Framework\Reflection\DataObjectProcessor::class => null, - Magento\Framework\Api\DataObjectHelper::class => null, - Magento\Framework\Translate\Inline::class => null, - Magento\Framework\Json\Encoder::class => null, - Magento\Customer\Model\ResourceModel\Customer::class => null, - Magento\Customer\Model\ResourceModel\CustomerRepository::class => null, - Laminas\Uri\Uri::class => null, - Magento\Customer\Model\Session\Validators\CutoffValidator::class => null, - Magento\Customer\Model\Customer::class => null, - Magento\Customer\Model\Session\SessionCleaner::class => null, - Magento\Tax\Model\Calculation::class => null, - Magento\Tax\Model\TaxCalculation::class => null, - Magento\SalesRule\Model\RulesApplier::class => null, - Magento\OfflineShipping\Model\SalesRule\Calculator::class => null, - Magento\OfflineShipping\Model\Quote\Address\FreeShipping::class => null, - Magento\SalesRule\Model\Validator::class => null, - Magento\Quote\Model\Quote\Address\Total\Collector::class => null, - Magento\Quote\Model\Quote\TotalsCollectorList::class => null, - Magento\Quote\Model\Quote\TotalsCollector::class => null, - Magento\Customer\Model\ResourceModel\Attribute::class => null, - Magento\GraphQlNewRelic\Plugin\ReportError::class => null, + 'addConfigurableProductsToCart' => [ + Magento\Eav\Plugin\Model\ResourceModel\Entity\Attribute::class => null, + Magento\ConfigurableProduct\Model\Quote\Item\CartItemProcessor::class => null, + ], + 'addDownloadableProductsToCart' => [ + Magento\Downloadable\Model\Quote\Item\CartItemProcessor::class => null, + ], + 'setShippingMethodsOnCart' => [ + Magento\Payment\Gateway\Config\ConfigFactory::class => null, + Magento\Payment\Gateway\Data\Quote\AddressAdapterFactory::class => null, ], 'placeOrder' => [ Magento\Framework\Lock\Proxy::class => null, - Magento\Framework\Url\QueryParamsResolver::class => null, - Magento\Framework\View\Asset\PreProcessor\Helper\Sort::class => null, - Magento\Framework\Filter\FilterManager::class => null, - Magento\Store\Model\Address\Renderer::class => null, - Magento\Quote\Model\ResourceModel\Quote::class => null, - Magento\Quote\Model\QuoteIdToMaskedQuoteId::class => null, - Magento\GraphQl\Quote\GetMaskedQuoteIdByReservedOrderId::class => null, - Magento\Framework\Reflection\MethodsMap::class => null, - Magento\Framework\Reflection\DataObjectProcessor::class => null, - Magento\Catalog\Model\Product\Attribute\Repository::class => null, Magento\Catalog\Model\ResourceModel\Category::class => null, - Magento\Catalog\Model\ResourceModel\Product::class => null, - Magento\Framework\Api\DataObjectHelper::class => null, Magento\CatalogGraphQl\Model\Resolver\Products\SearchCriteria\CollectionProcessor\FilterProcessor\CategoryFilter::class => null, - Magento\Framework\Translate\Inline::class => null, - Magento\Framework\Json\Encoder::class => null, - Magento\Directory\Helper\Data::class => null, - Magento\Customer\Model\ResourceModel\AddressRepository::class => null, - Magento\Customer\Model\ResourceModel\Customer::class => null, - Magento\Customer\Model\ResourceModel\CustomerRepository::class => null, - Laminas\Uri\Uri::class => null, - Magento\Customer\Model\Session\Validators\CutoffValidator::class => null, - Magento\Customer\Model\Customer::class => null, - Magento\Customer\Model\Session\SessionCleaner::class => null, - Magento\Tax\Model\Calculation::class => null, - Magento\Tax\Model\TaxCalculation::class => null, - Magento\SalesRule\Model\RulesApplier::class => null, - Magento\OfflineShipping\Model\SalesRule\Calculator::class => null, - Magento\OfflineShipping\Model\Quote\Address\FreeShipping::class => null, - Magento\SalesRule\Model\Validator::class => null, - Magento\Quote\Model\Quote\Address\Total\Collector::class => null, - Magento\Quote\Model\Quote\TotalsCollectorList::class => null, - Magento\Quote\Model\Quote\TotalsCollector::class => null, Magento\Sales\Model\Order\ItemRepository::class => null, - Magento\Sales\Model\ResourceModel\Order\Payment::class => null, Magento\Sales\Model\ResourceModel\Order\Relation::class => null, - Magento\Sales\Model\ResourceModel\Order::class => null, Magento\Sales\Model\OrderIncrementIdChecker::class => null, - Magento\QuoteGraphQl\Plugin\ProductAttributesExtender::class => null, Magento\Tax\Model\Quote\ToOrderConverter::class => null, - Magento\Quote\Model\Quote::class => null, Magento\Sales\Model\ResourceModel\Attribute::class => null, Magento\Sales\Model\ResourceModel\Order\Handler\Address::class => null, - Magento\Sales\Model\ResourceModel\Order\Status\History::class => null, - Magento\CustomerCustomAttributes\Model\ResourceModel\Sales\Quote::class => null, Magento\Indexer\Model\Indexer\DeferredCacheContext::class => null, Magento\Indexer\Model\Indexer\DeferredCacheCleaner::class => null, Magento\Catalog\Model\ResourceModel\Product\Indexer\Price\IndexTableStructureFactory::class => null, @@ -544,92 +97,27 @@ Magento\SalesRule\Api\Data\RuleSearchResultInterfaceFactory::class => null, Magento\SalesRule\Model\RuleRepository::class => null, Magento\Reward\Model\SalesRule\RewardPointCounter::class => null, - Magento\GraphQlNewRelic\Plugin\ReportError::class => null, Magento\NegotiableQuote\Model\Restriction\Customer::class => null, Magento\NegotiableQuote\Model\Restriction\Admin::class => null, Magento\SharedCatalog\Plugin\Catalog\Model\ResourceModel\Product\Indexer\BaseFinalPricePlugin::class => null, ], 'createCustomer' => [ Magento\Framework\Logger\LoggerProxy::class => null, - Magento\Framework\View\Asset\PreProcessor\Helper\Sort::class => null, - Magento\Framework\Filter\FilterManager::class => null, - Magento\Store\Model\Address\Renderer::class => null, - Magento\Customer\Model\CustomerRegistry::class => null, - Magento\Eav\Model\ResourceModel\Entity\Attribute\Set::class => null, - Magento\Eav\Model\Entity\Attribute\Set::class => null, - Magento\Eav\Model\Entity\VersionControl\Metadata::class => null, - Magento\Customer\Model\ResourceModel\Address\Relation::class => null, - Magento\Framework\Validator\Factory::class => null, - Magento\Customer\Model\ResourceModel\Address::class => null, - Magento\Framework\Translate\Inline\ConfigInterface\Proxy::class => null, - Magento\Framework\Translate\Inline::class => null, - Magento\Framework\Json\Helper\Data::class => null, - Magento\Directory\Helper\Data::class => null, - Magento\TestFramework\Api\Config\Reader\FileResolver::class => null, - Magento\Framework\Api\ExtensionAttribute\JoinProcessor::class => null, - Magento\Customer\Model\ResourceModel\AddressRepository::class => null, - Magento\Framework\Reflection\MethodsMap::class => null, - Magento\Framework\Reflection\ExtensionAttributesProcessor\Proxy::class => null, - Magento\Framework\Reflection\DataObjectProcessor::class => null, - Magento\Framework\Api\DataObjectHelper::class => null, - Magento\Customer\Model\AttributeMetadataConverter::class => null, - Magento\Customer\Model\Metadata\CustomerMetadata::class => null, - Magento\Customer\Model\Metadata\AttributeMetadataCache::class => null, - Magento\Customer\Model\Metadata\CustomerCachedMetadata::class => null, - Magento\Customer\Model\Config\Share::class => null, - Magento\Customer\Model\ResourceModel\Customer::class => null, - Magento\Framework\Api\ImageProcessor::class => null, - Magento\Customer\Model\Session\Proxy::class => null, - Magento\Customer\Model\Delegation\Storage::class => null, Magento\Customer\Model\GroupRegistry::class => null, - Magento\Framework\Model\ResourceModel\Db\VersionControl\Metadata::class => null, - Magento\Framework\Model\ResourceModel\Db\VersionControl\Snapshot::class => null, - Magento\Tax\Model\TaxClass\Repository::class => null, - Magento\Customer\Model\ResourceModel\GroupRepository::class => null, - Magento\Customer\Model\ResourceModel\CustomerRepository::class => null, Magento\TestFramework\Mail\Template\TransportBuilderMock::class => null, - Magento\Customer\Helper\View::class => null, - Magento\Framework\Indexer\IndexerRegistry::class => null, - Magento\Customer\Model\Customer::class => null, - Magento\Framework\Session\SessionMaxSizeConfig::class => null, - Magento\Framework\Session\SaveHandler::class => null, - Magento\Paypal\Plugin\TransparentSessionChecker::class => null, - Laminas\Uri\Uri::class => null, - Magento\Backend\App\Area\FrontNameResolver::class => null, - Magento\Backend\Helper\Data::class => null, - Magento\GraphQl\Plugin\DisableSession::class => null, - Magento\Framework\Session\Generic::class => null, - Magento\Customer\Model\Session\SessionCleaner::class => null, - Magento\Customer\Model\Authorization\CustomerSessionUserContext::class => null, - Magento\JwtUserToken\Model\ResourceModel\FastStorageRevokedWrapper::class => null, - Magento\Webapi\Model\Authorization\TokenUserContext::class => null, - Magento\Authorization\Model\CompositeUserContext::class => null, - Magento\Webapi\Model\WebapiRoleLocator::class => null, - Magento\Customer\Model\Authentication::class => null, - 'CustomerAddressSnapshot' => null, - 'EavVersionControlSnapshot' => null, Magento\Catalog\Helper\Product\Flat\Indexer::class => null, Magento\Catalog\Helper\Product::class => null, Magento\Framework\Url\Helper\Data::class => null, - Magento\Customer\Model\Session::class => null, - Magento\Framework\Validator\EmailAddress::class => null, - Magento\CustomerGraphQl\Model\Customer\ValidateCustomerData\ValidateEmail::class => null, - Magento\CustomerGraphQl\Model\Customer\ValidateCustomerData::class => null, Magento\Newsletter\Model\CustomerSubscriberCache::class => null, Magento\Newsletter\Model\SubscriptionManager::class => null, Magento\LoginAsCustomerAssistance\Model\IsAssistanceEnabled::class => null, - Magento\Framework\MessageQueue\Code\Generator\Config\RemoteServiceReader\Communication::class => null, - Magento\Framework\Webapi\ServiceInputProcessor::class => null, Magento\Framework\MessageQueue\Publisher\Config\RemoteService\Reader::class => null, Magento\Framework\Pricing\Helper\Data::class => null, Magento\Catalog\Helper\Category::class => null, - Magento\Catalog\Helper\Data::class => null, Magento\Tax\Helper\Data::class => null, Magento\Weee\Helper\Data::class => null, - Magento\Quote\Model\Quote\Address\Total\Collector::class => null, Magento\Catalog\Helper\Product\Configuration::class => null, Magento\Bundle\Helper\Catalog\Product\Configuration::class => null, - Magento\Eav\Model\AttributeDataFactory::class => null, Magento\PageCache\Model\Cache\Server::class => null, Magento\Catalog\Helper\Product\Edit\Action\Attribute::class => null, Magento\Newsletter\Model\Plugin\CustomerPlugin::class => null, @@ -640,375 +128,194 @@ Magento\Store\Model\Argument\Interpreter\ServiceUrl::class => null, Magento\Framework\View\Layout\Argument\Interpreter\Url::class => null, Magento\Framework\Css\PreProcessor\Adapter\CssInliner::class => null, - Magento\Framework\Module\ModuleList::class => null, - Magento\Framework\Module\Manager::class => null, Magento\Authorization\Model\UserContextInterface\Proxy::class => null, Magento\Catalog\Controller\Adminhtml\Product\Initialization\Helper::class => null, - Magento\Catalog\Model\Product\Attribute\Repository::class => null, - Magento\Catalog\Model\ProductRepository::class => null, Magento\Framework\DataObject\Copy::class => null, Magento\Quote\Model\Quote\Item\Processor::class => null, Magento\Sales\Model\Config::class => null, - Magento\Customer\Model\Session\Validators\CutoffValidator::class => null, Magento\Customer\Model\Session\Storage::class => null, - Magento\Tax\Model\Calculation::class => null, - Magento\OfflineShipping\Model\SalesRule\Calculator::class => null, - Magento\SalesRule\Model\Validator::class => null, - Magento\Sales\Model\ResourceModel\Order\Payment::class => null, - Magento\Sales\Model\ResourceModel\Order\Status\History::class => null, - Magento\Sales\Model\ResourceModel\Order::class => null, - Magento\Quote\Model\ResourceModel\Quote::class => null, - Magento\Quote\Model\Quote::class => null, Magento\Backend\Model\Session::class => null, - Magento\Checkout\Model\Session::class => null, Magento\Quote\Model\ResourceModel\Quote\Item::class => null, Magento\Backend\Model\Menu\Config::class => null, Magento\Backend\Model\Url::class => null, Magento\Customer\Model\Indexer\AttributeProvider::class => null, Magento\Framework\App\Cache\FlushCacheByTags::class => null, - Magento\CustomerGraphQl\Model\Context\AddUserInfoToContext::class => null, Magento\Eav\Helper\Data::class => null, ], 'updateCustomer' => [ - Magento\Framework\Url\QueryParamsResolver::class => null, - Magento\Framework\Registry::class => null, - Magento\Customer\Model\AddressRegistry::class => null, - Magento\Customer\Model\CustomerRegistry::class => null, - Magento\Eav\Model\ResourceModel\Entity\Attribute\Set::class => null, - Magento\Eav\Model\Entity\Attribute\Set::class => null, - Magento\Eav\Model\Entity\VersionControl\Metadata::class => null, - 'CustomerAddressSnapshot' => null, - Magento\Customer\Model\ResourceModel\Address\Relation::class => null, - Magento\Framework\Validator\Factory::class => null, - Magento\Customer\Api\CustomerRepositoryInterface\Proxy::class => null, - Magento\Customer\Model\ResourceModel\Address::class => null, - Magento\Framework\Translate\Inline\ConfigInterface\Proxy::class => null, - Magento\Framework\Translate\Inline::class => null, - Magento\Framework\Json\Helper\Data::class => null, - Magento\Directory\Helper\Data::class => null, - Magento\TestFramework\Api\Config\Reader\FileResolver::class => null, - Magento\Framework\Api\ExtensionAttribute\JoinProcessor::class => null, - Magento\Customer\Model\ResourceModel\AddressRepository::class => null, + Magento\LoginAsCustomerAssistance\Model\SetAssistance::class => null, + Magento\LoginAsCustomerAssistance\Plugin\CustomerPlugin::class => null, + ], + 'updateCustomerAddress' => [ + Magento\Customer\Model\Metadata\AddressMetadata::class => null, + Magento\Customer\Model\Metadata\AddressCachedMetadata::class => null, + ], + 'updateCustomerEmail' => [ + Magento\GraphQlCache\Model\Plugin\Auth\TokenIssuer::class => null, + ], + 'getCart' => [ + Magento\Payment\Model\MethodList::class => null, + Magento\Quote\Model\PaymentMethodManagement::class => null, + Magento\Quote\Model\Quote\Interceptor::class => null, + Magento\Quote\Model\ResourceModel\Quote\Item\Collection\Interceptor::class => null, + Magento\User\Model\User\Interceptor::class => null, + Magento\Quote\Model\ShippingAssignment::class => null, + Magento\Quote\Model\Shipping::class => null, + Magento\Framework\ObjectManager\TMap::class => null, + Magento\Payment\Gateway\Config\ValueHandlerPool::class => null, + Magento\Payment\Model\Method\Adapter::class => null, + ], + '*' => [ + Magento\Quote\Model\Quote\Item\Interceptor::class => null, + Magento\Framework\Stdlib\ArrayManager::class => null, + Magento\Config\Model\Config\Processor\EnvironmentPlaceholder::class => null, + Magento\Quote\Model\Quote\Address\Interceptor::class => null, + Magento\GraphQlNewRelic\Plugin\ReportError::class => null, + Magento\Quote\Model\ResourceModel\Quote::class => null, + Magento\Customer\Model\ResourceModel\Attribute::class => null, + Magento\Quote\Model\QuoteIdToMaskedQuoteId::class => null, + Magento\GraphQl\Quote\GetMaskedQuoteIdByReservedOrderId::class => null, Magento\Framework\Reflection\MethodsMap::class => null, - Magento\Framework\Reflection\ExtensionAttributesProcessor\Proxy::class => null, Magento\Framework\Reflection\DataObjectProcessor::class => null, + Magento\Catalog\Model\ResourceModel\Product::class => null, Magento\Framework\Api\DataObjectHelper::class => null, - Magento\Customer\Model\AttributeMetadataConverter::class => null, - Magento\Customer\Model\AttributeMetadataDataProvider::class => null, - Magento\Customer\Model\Metadata\CustomerMetadata::class => null, - Magento\Customer\Model\Metadata\AttributeMetadataCache::class => null, - Magento\Customer\Model\Metadata\CustomerCachedMetadata::class => null, - Magento\Customer\Model\Config\Share::class => null, - 'EavVersionControlSnapshot' => null, - Magento\Customer\Model\AccountConfirmation::class => null, + Magento\Catalog\Model\ProductRepository::class => null, + Magento\CatalogInventory\Model\StockRegistryProvider::class => null, + Magento\CatalogInventory\Model\StockRegistry::class => null, + Magento\Framework\Translate\Inline::class => null, + Magento\Framework\Json\Encoder::class => null, Magento\Customer\Model\ResourceModel\Customer::class => null, - Magento\Framework\Api\ImageProcessor::class => null, - Magento\Customer\Model\Session\Proxy::class => null, - Magento\Customer\Model\Delegation\Storage::class => null, - Magento\Customer\Model\GroupRegistry::class => null, - Magento\Framework\Model\ResourceModel\Db\VersionControl\Metadata::class => null, - Magento\Framework\Model\ResourceModel\Db\VersionControl\Snapshot::class => null, - Magento\Tax\Model\TaxClass\Repository::class => null, - Magento\Customer\Model\ResourceModel\GroupRepository::class => null, Magento\Customer\Model\ResourceModel\CustomerRepository::class => null, - Magento\Customer\Helper\View::class => null, - Magento\Framework\Indexer\IndexerRegistry::class => null, + Magento\Customer\Model\Session\Validators\CutoffValidator::class => null, Magento\Customer\Model\Customer::class => null, - Magento\Framework\Session\SessionMaxSizeConfig::class => null, - Magento\Framework\Session\SaveHandler::class => null, - Magento\Framework\Session\Storage::class => null, - Magento\Paypal\Plugin\TransparentSessionChecker::class => null, - Laminas\Uri\Uri::class => null, - Magento\Backend\App\Area\FrontNameResolver::class => null, - Magento\Backend\Helper\Data::class => null, - Magento\GraphQl\Plugin\DisableSession::class => null, - Magento\Framework\Session\Generic::class => null, Magento\Customer\Model\Session\SessionCleaner::class => null, - Magento\Customer\Model\Authorization\CustomerSessionUserContext::class => null, - Magento\JwtUserToken\Model\ConfigurableJwtSettingsProvider::class => null, - Magento\JwtUserToken\Model\Reader::class => null, - Magento\JwtUserToken\Model\ResourceModel\FastStorageRevokedWrapper::class => null, - Magento\Webapi\Model\Authorization\TokenUserContext::class => null, - Magento\Authorization\Model\CompositeUserContext::class => null, - Magento\Webapi\Model\WebapiRoleLocator::class => null, - Magento\Customer\Model\Authentication::class => null, - Magento\Customer\Model\AccountManagement::class => null, - Magento\Framework\MessageQueue\Code\Generator\Config\RemoteServiceReader\Communication::class => null, - Magento\Framework\Webapi\ServiceInputProcessor::class => null, - Magento\Framework\MessageQueue\Publisher\Config\RemoteService\Reader::class => null, - Magento\Customer\Model\Session::class => null, - Magento\Customer\Model\Plugin\CustomerFlushFormKey::class => null, - Magento\CustomerGraphQl\Model\Context\AddUserInfoToContext::class => null, Magento\Tax\Model\Calculation::class => null, - Magento\Catalog\Helper\Data::class => null, - Magento\Checkout\Model\Session::class => null, - Magento\Bundle\Pricing\Price\TaxPrice::class => null, - Magento\Eav\Model\AttributeDataFactory::class => null, - Magento\Customer\Observer\AfterAddressSaveObserver::class => null, - Magento\LoginAsCustomer\Model\GetLoggedAsCustomerAdminId::class => null, - Magento\LoginAsCustomerAssistance\Model\SetAssistance::class => null, - Magento\LoginAsCustomerAssistance\Plugin\CustomerPlugin::class => null, - Magento\CustomerGraphQl\Plugin\ClearCustomerSessionAfterRequest::class => null, - Magento\Framework\Module\ModuleList::class => null, - Magento\Framework\Module\Manager::class => null, - Magento\Framework\Translate\Inline\Proxy::class => null, - ], - 'updateCustomerAddress' => [ + Magento\Tax\Model\TaxCalculation::class => null, + Magento\SalesRule\Model\RulesApplier::class => null, + Magento\OfflineShipping\Model\SalesRule\Calculator::class => null, + Magento\OfflineShipping\Model\Quote\Address\FreeShipping::class => null, + Magento\SalesRule\Model\Validator::class => null, + Magento\Quote\Model\Quote\Address\Total\Collector::class => null, + Magento\Quote\Model\Quote\TotalsCollectorList::class => null, + Magento\Quote\Model\Quote\TotalsCollector::class => null, + Magento\User\Helper\Data::class => null, + Magento\Authorization\Model\RoleFactory::class => null, + Magento\User\Model\UserValidationRules::class => null, + Magento\Framework\Acl\Data\Cache::class => null, + Magento\User\Model\Backend\Config\ObserverConfig::class => null, + Magento\User\Model\ResourceModel\User::class => null, + Magento\User\Model\Notificator::class => null, + Magento\TestModuleCatalogInventoryCache\Plugin\PreventCachingPreloadedStockDataInToStockRegistry::class => null, + Magento\Quote\Model\Quote\ProductOptionFactory::class => null, + Magento\Quote\Api\Data\ProductOptionExtensionFactory::class => null, + Magento\Catalog\Model\CustomOptions\CustomOptionProcessor::class => null, + 'orderMetadata' => null, + Magento\InventorySalesAsyncOrder\Model\ReservationExecution::class => null, + Magento\Sales\Api\Data\OrderSearchResultInterfaceFactory::class => null, + Magento\Sales\Api\Data\OrderExtensionFactory::class => null, + Magento\Payment\Api\Data\PaymentAdditionalInfoInterfaceFactory::class => null, + Magento\Sales\Model\OrderRepository::class => null, + Magento\InventorySalesAsyncOrder\Plugin\SkipAsyncOrderCheckDataWithNoDeferredStockUpdatePlugin::class => null, + Magento\InventoryInStorePickup\Model\ExtractPickupLocationAddressData::class => null, + Magento\InventoryInStorePickupQuote\Model\ExtractQuoteAddressShippingAddressData::class => null, + Magento\InventoryInStorePickupQuote\Model\GetShippingAddressData::class => null, + Magento\InventoryInStorePickupQuote\Model\IsPickupLocationShippingAddress::class => null, + Magento\InventoryInStorePickupQuote\Model\ToQuoteAddress::class => null, + Magento\InventoryInStorePickupQuote\Model\GetWebsiteCodeByStoreId::class => null, + Magento\InventoryInStorePickupQuote\Plugin\Quote\ReplaceShippingAddressForShippingAddressManagement::class => null, + Magento\CustomerCustomAttributes\Model\ResourceModel\Sales\Quote::class => null, + Magento\NegotiableQuote\Model\Plugin\Quote\Model\ShippingAssignmentPersisterPlugin::class => null, + Magento\PurchaseOrder\Plugin\Quote\Model\QuoteRepositoryPlugin::class => null, + Magento\Catalog\Model\Config::class => null, + Magento\Downloadable\Model\Url\DomainValidator::class => null, + Magento\Staging\Model\VersionManager::class => null, + Magento\Staging\Model\Url\BaseUrlModifier::class => null, + Magento\Staging\Model\Event\Manager::class => null, + Magento\CatalogStaging\Plugin\Catalog\Model\Indexer\AbstractFlatState::class => null, Magento\Framework\Url\QueryParamsResolver::class => null, - Magento\Framework\Registry::class => null, - Magento\Customer\Model\AddressRegistry::class => null, + Magento\Directory\Helper\Data::class => null, + Magento\Customer\Model\ResourceModel\AddressRepository::class => null, + Magento\Framework\View\Asset\PreProcessor\Helper\Sort::class => null, + Magento\Framework\Filter\FilterManager::class => null, + Magento\Store\Model\Address\Renderer::class => null, + Magento\Catalog\Model\Product\Attribute\Repository::class => null, + Magento\Sales\Model\ResourceModel\Order\Payment::class => null, + Magento\Sales\Model\ResourceModel\Order::class => null, + Magento\QuoteGraphQl\Plugin\ProductAttributesExtender::class => null, + Magento\Quote\Model\Quote::class => null, + Magento\Sales\Model\ResourceModel\Attribute::class => null, Magento\Customer\Model\CustomerRegistry::class => null, Magento\Eav\Model\ResourceModel\Entity\Attribute\Set::class => null, Magento\Eav\Model\Entity\Attribute\Set::class => null, Magento\Eav\Model\Entity\VersionControl\Metadata::class => null, - 'CustomerAddressSnapshot' => null, Magento\Customer\Model\ResourceModel\Address\Relation::class => null, Magento\Framework\Validator\Factory::class => null, - Magento\Customer\Api\CustomerRepositoryInterface\Proxy::class => null, Magento\Customer\Model\ResourceModel\Address::class => null, Magento\Framework\Translate\Inline\ConfigInterface\Proxy::class => null, - Magento\Framework\Translate\Inline::class => null, Magento\Framework\Json\Helper\Data::class => null, - Magento\Directory\Helper\Data::class => null, Magento\TestFramework\Api\Config\Reader\FileResolver::class => null, Magento\Framework\Api\ExtensionAttribute\JoinProcessor::class => null, - Magento\Customer\Model\ResourceModel\AddressRepository::class => null, - Magento\Framework\Reflection\MethodsMap::class => null, Magento\Framework\Reflection\ExtensionAttributesProcessor\Proxy::class => null, - Magento\Framework\Reflection\DataObjectProcessor::class => null, - Magento\Framework\Api\DataObjectHelper::class => null, Magento\Customer\Model\AttributeMetadataConverter::class => null, - Magento\Customer\Model\AttributeMetadataDataProvider::class => null, Magento\Customer\Model\Metadata\CustomerMetadata::class => null, Magento\Customer\Model\Metadata\AttributeMetadataCache::class => null, Magento\Customer\Model\Metadata\CustomerCachedMetadata::class => null, Magento\Customer\Model\Config\Share::class => null, - 'EavVersionControlSnapshot' => null, - Magento\Customer\Model\AccountConfirmation::class => null, - Magento\Customer\Model\ResourceModel\Customer::class => null, Magento\Framework\Api\ImageProcessor::class => null, Magento\Customer\Model\Session\Proxy::class => null, Magento\Customer\Model\Delegation\Storage::class => null, - Magento\Tax\Model\TaxClass\Repository::class => null, - Magento\Customer\Model\ResourceModel\CustomerRepository::class => null, + Magento\Framework\Model\ResourceModel\Db\VersionControl\Metadata::class => null, + Magento\Framework\Model\ResourceModel\Db\VersionControl\Snapshot::class => null, + Magento\Customer\Model\ResourceModel\GroupRepository::class => null, Magento\Customer\Helper\View::class => null, Magento\Framework\Indexer\IndexerRegistry::class => null, - Magento\Customer\Model\Customer::class => null, Magento\Framework\Session\SessionMaxSizeConfig::class => null, - Magento\Framework\Session\SaveHandler::class => null, - Magento\Framework\Session\Storage::class => null, Magento\Paypal\Plugin\TransparentSessionChecker::class => null, - Laminas\Uri\Uri::class => null, Magento\Backend\App\Area\FrontNameResolver::class => null, Magento\Backend\Helper\Data::class => null, Magento\GraphQl\Plugin\DisableSession::class => null, Magento\Framework\Session\Generic::class => null, - Magento\Customer\Model\Session\SessionCleaner::class => null, Magento\Customer\Model\Authorization\CustomerSessionUserContext::class => null, - Magento\JwtUserToken\Model\ConfigurableJwtSettingsProvider::class => null, - Magento\JwtUserToken\Model\Reader::class => null, + Magento\Tax\Model\TaxClass\Repository::class => null, Magento\JwtUserToken\Model\ResourceModel\FastStorageRevokedWrapper::class => null, Magento\Webapi\Model\Authorization\TokenUserContext::class => null, Magento\Authorization\Model\CompositeUserContext::class => null, + Magento\Webapi\Model\WebapiRoleLocator::class => null, Magento\Customer\Model\Authentication::class => null, - Magento\Customer\Model\AccountManagement::class => null, + 'CustomerAddressSnapshot' => null, + 'EavVersionControlSnapshot' => null, + Magento\Customer\Model\Session::class => null, + Magento\Framework\Validator\EmailAddress::class => null, + Magento\CustomerGraphQl\Model\Customer\ValidateCustomerData\ValidateEmail::class => null, + Magento\CustomerGraphQl\Model\Customer\ValidateCustomerData::class => null, Magento\Framework\MessageQueue\Code\Generator\Config\RemoteServiceReader\Communication::class => null, Magento\Framework\Webapi\ServiceInputProcessor::class => null, Magento\Framework\MessageQueue\Publisher\Config\RemoteService\Reader::class => null, - Magento\Customer\Model\Session::class => null, - Magento\Customer\Model\Plugin\CustomerFlushFormKey::class => null, - Magento\CustomerGraphQl\Model\Context\AddUserInfoToContext::class => null, - Magento\Tax\Model\Calculation::class => null, - Magento\Eav\Model\AttributeDataFactory::class => null, - Magento\Customer\Observer\AfterAddressSaveObserver::class => null, - Magento\LoginAsCustomer\Model\GetLoggedAsCustomerAdminId::class => null, - Magento\Framework\App\View::class => null, - Magento\Framework\App\Action\Context::class => null, Magento\Catalog\Helper\Data::class => null, - Magento\Checkout\Model\Session::class => null, - Magento\Bundle\Pricing\Price\TaxPrice::class => null, - Magento\CustomerGraphQl\Plugin\ClearCustomerSessionAfterRequest::class => null, + Magento\Eav\Model\AttributeDataFactory::class => null, Magento\Framework\Module\ModuleList::class => null, Magento\Framework\Module\Manager::class => null, - Magento\Framework\Translate\Inline\Proxy::class => null, - Magento\Customer\Model\Metadata\AddressMetadata::class => null, - Magento\Customer\Model\Metadata\AddressCachedMetadata::class => null, - ], - 'updateCustomerEmail' => [ - Magento\Framework\Url\QueryParamsResolver::class => null, + Magento\Checkout\Model\Session::class => null, + Magento\CustomerGraphQl\Model\Context\AddUserInfoToContext::class => null, Magento\Framework\Registry::class => null, Magento\Customer\Model\AddressRegistry::class => null, - Magento\Customer\Model\CustomerRegistry::class => null, - Magento\Eav\Model\ResourceModel\Entity\Attribute\Set::class => null, - Magento\Eav\Model\Entity\Attribute\Set::class => null, - Magento\Eav\Model\Entity\VersionControl\Metadata::class => null, - 'CustomerAddressSnapshot' => null, - Magento\Customer\Model\ResourceModel\Address\Relation::class => null, - Magento\Framework\Validator\Factory::class => null, - Magento\Customer\Api\CustomerRepositoryInterface\Proxy::class => null, - Magento\Customer\Model\ResourceModel\Address::class => null, - Magento\Framework\Translate\Inline\ConfigInterface\Proxy::class => null, - Magento\Framework\Translate\Inline::class => null, - Magento\Framework\Json\Helper\Data::class => null, - Magento\Directory\Helper\Data::class => null, - Magento\TestFramework\Api\Config\Reader\FileResolver::class => null, - Magento\Framework\Api\ExtensionAttribute\JoinProcessor::class => null, - Magento\Customer\Model\ResourceModel\AddressRepository::class => null, - Magento\Framework\Reflection\MethodsMap::class => null, - Magento\Framework\Reflection\ExtensionAttributesProcessor\Proxy::class => null, - Magento\Framework\Reflection\DataObjectProcessor::class => null, - Magento\Framework\Api\DataObjectHelper::class => null, - Magento\Customer\Model\AttributeMetadataConverter::class => null, Magento\Customer\Model\AttributeMetadataDataProvider::class => null, - Magento\Customer\Model\Metadata\CustomerMetadata::class => null, - Magento\Customer\Model\Metadata\AttributeMetadataCache::class => null, - Magento\Customer\Model\Metadata\CustomerCachedMetadata::class => null, - Magento\Customer\Model\Config\Share::class => null, - 'EavVersionControlSnapshot' => null, Magento\Customer\Model\AccountConfirmation::class => null, - Magento\Customer\Model\ResourceModel\Customer::class => null, - Magento\Framework\Api\ImageProcessor::class => null, - Magento\Customer\Model\Session\Proxy::class => null, - Magento\Customer\Model\Delegation\Storage::class => null, - Magento\Customer\Model\GroupRegistry::class => null, - Magento\Framework\Model\ResourceModel\Db\VersionControl\Metadata::class => null, - Magento\Framework\Model\ResourceModel\Db\VersionControl\Snapshot::class => null, - Magento\Tax\Model\TaxClass\Repository::class => null, - Magento\Customer\Model\ResourceModel\GroupRepository::class => null, - Magento\Customer\Model\ResourceModel\CustomerRepository::class => null, - Magento\Customer\Helper\View::class => null, - Magento\Framework\Indexer\IndexerRegistry::class => null, - Magento\Customer\Model\Customer::class => null, - Magento\Framework\Session\SessionMaxSizeConfig::class => null, - Magento\Framework\Session\SaveHandler::class => null, Magento\Framework\Session\Storage::class => null, - Magento\Paypal\Plugin\TransparentSessionChecker::class => null, - Laminas\Uri\Uri::class => null, - Magento\Backend\App\Area\FrontNameResolver::class => null, - Magento\Backend\Helper\Data::class => null, - Magento\GraphQl\Plugin\DisableSession::class => null, - Magento\Framework\Session\Generic::class => null, - Magento\Customer\Model\Session\SessionCleaner::class => null, - Magento\Customer\Model\Authorization\CustomerSessionUserContext::class => null, Magento\JwtUserToken\Model\ConfigurableJwtSettingsProvider::class => null, Magento\JwtUserToken\Model\Reader::class => null, - Magento\JwtUserToken\Model\ResourceModel\FastStorageRevokedWrapper::class => null, - Magento\Webapi\Model\Authorization\TokenUserContext::class => null, - Magento\Authorization\Model\CompositeUserContext::class => null, - Magento\Webapi\Model\WebapiRoleLocator::class => null, - Magento\Customer\Model\Authentication::class => null, Magento\Customer\Model\AccountManagement::class => null, - Magento\Framework\MessageQueue\Code\Generator\Config\RemoteServiceReader\Communication::class => null, - Magento\Framework\Webapi\ServiceInputProcessor::class => null, - Magento\Framework\MessageQueue\Publisher\Config\RemoteService\Reader::class => null, - Magento\Customer\Model\Session::class => null, Magento\Customer\Model\Plugin\CustomerFlushFormKey::class => null, - Magento\CustomerGraphQl\Model\Context\AddUserInfoToContext::class => null, - Magento\Tax\Model\Calculation::class => null, - Magento\Catalog\Helper\Data::class => null, - Magento\Checkout\Model\Session::class => null, Magento\Bundle\Pricing\Price\TaxPrice::class => null, - Magento\Eav\Model\AttributeDataFactory::class => null, Magento\Customer\Observer\AfterAddressSaveObserver::class => null, Magento\LoginAsCustomer\Model\GetLoggedAsCustomerAdminId::class => null, Magento\CustomerGraphQl\Plugin\ClearCustomerSessionAfterRequest::class => null, - Magento\Framework\Module\ModuleList::class => null, - Magento\Framework\Module\Manager::class => null, - Magento\GraphQlCache\Model\Plugin\Auth\TokenIssuer::class => null, - Magento\Framework\Validator\EmailAddress::class => null, - Magento\CustomerGraphQl\Model\Customer\ValidateCustomerData\ValidateEmail::class => null, - Magento\CustomerGraphQl\Model\Customer\ValidateCustomerData::class => null, + Magento\Framework\Translate\Inline\Proxy::class => null, + Magento\Customer\Api\CustomerRepositoryInterface\Proxy::class => null, Magento\Framework\App\View::class => null, Magento\Framework\App\Action\Context::class => null, - Magento\Quote\Model\Quote\Address\Total\Collector::class => null, - ], - 'generateCustomerToken' => [ - Magento\Customer\Model\CustomerRegistry::class => null, - Magento\Eav\Model\ResourceModel\Entity\Attribute\Set::class => null, - Magento\Eav\Model\Entity\Attribute\Set::class => null, - Magento\Eav\Model\Entity\VersionControl\Metadata::class => null, - 'CustomerAddressSnapshot' => null, - Magento\Customer\Model\ResourceModel\Address\Relation::class => null, - Magento\Customer\Api\CustomerRepositoryInterface\Proxy::class => null, - Magento\Customer\Model\ResourceModel\Address::class => null, - Magento\Framework\Translate\Inline\ConfigInterface\Proxy::class => null, - Magento\Framework\Translate\Inline::class => null, - Magento\Framework\Json\Helper\Data::class => null, - Magento\Directory\Helper\Data::class => null, - Magento\TestFramework\Api\Config\Reader\FileResolver::class => null, - Magento\Framework\Api\ExtensionAttribute\JoinProcessor::class => null, - Magento\Customer\Model\ResourceModel\AddressRepository::class => null, - Magento\Framework\Reflection\MethodsMap::class => null, - Magento\Framework\Reflection\ExtensionAttributesProcessor\Proxy::class => null, - Magento\Framework\Reflection\DataObjectProcessor::class => null, - Magento\Framework\Api\DataObjectHelper::class => null, - Magento\Customer\Model\AttributeMetadataConverter::class => null, - Magento\Customer\Model\AttributeMetadataDataProvider::class => null, - Magento\Customer\Model\Metadata\CustomerMetadata::class => null, - Magento\Customer\Model\Metadata\AttributeMetadataCache::class => null, - Magento\Customer\Model\Metadata\CustomerCachedMetadata::class => null, - Magento\Customer\Model\Config\Share::class => null, - 'EavVersionControlSnapshot' => null, - Magento\Customer\Model\ResourceModel\Customer::class => null, - Magento\Framework\Api\ImageProcessor::class => null, - Magento\Customer\Model\Session\Proxy::class => null, - Magento\Customer\Model\Delegation\Storage::class => null, - Magento\Tax\Model\TaxClass\Repository::class => null, - Magento\Customer\Model\ResourceModel\CustomerRepository::class => null, - Magento\Customer\Helper\View::class => null, - Magento\Customer\Model\Customer::class => null, - Magento\Framework\Session\SessionMaxSizeConfig::class => null, - Magento\Framework\Session\SaveHandler::class => null, - Magento\Framework\Session\Storage::class => null, - Magento\Paypal\Plugin\TransparentSessionChecker::class => null, - Laminas\Uri\Uri::class => null, - Magento\Backend\App\Area\FrontNameResolver::class => null, - Magento\Backend\Helper\Data::class => null, - Magento\GraphQl\Plugin\DisableSession::class => null, - Magento\Framework\Session\Generic::class => null, - Magento\Customer\Model\Session\SessionCleaner::class => null, - Magento\Customer\Model\Authorization\CustomerSessionUserContext::class => null, - Magento\JwtUserToken\Model\ConfigurableJwtSettingsProvider::class => null, - Magento\JwtUserToken\Model\Reader::class => null, - Magento\JwtUserToken\Model\ResourceModel\FastStorageRevokedWrapper::class => null, - Magento\Webapi\Model\Authorization\TokenUserContext::class => null, - Magento\Authorization\Model\CompositeUserContext::class => null, - Magento\Customer\Model\Authentication::class => null, - Magento\Customer\Model\Session::class => null, - Magento\Framework\MessageQueue\Code\Generator\Config\RemoteServiceReader\Communication::class => null, - Magento\Framework\Webapi\ServiceInputProcessor::class => null, - Magento\Framework\MessageQueue\Publisher\Config\RemoteService\Reader::class => null, - ], - 'getCustomer' => [ - Magento\JwtUserToken\Model\ConfigurableJwtSettingsProvider::class => null, - Magento\JwtUserToken\Model\Reader::class => null, - ], - 'getCart' => [ - Magento\Framework\Model\ResourceModel\Db\VersionControl\Metadata::class => null, - Magento\Framework\Model\ResourceModel\Db\VersionControl\Snapshot::class => null, Laminas\Uri\Uri::class => null, - Magento\Framework\Reflection\MethodsMap::class => null, - Magento\Framework\Reflection\DataObjectProcessor::class => null, - Magento\Framework\Api\DataObjectHelper::class => null, - Magento\Framework\Translate\Inline::class => null, - Magento\Framework\Json\Encoder::class => null, - Magento\Quote\Model\Quote\Address\Total\Collector::class => null, - Magento\Quote\Model\Quote\TotalsCollectorList::class => null, - Magento\Quote\Model\Quote\TotalsCollector::class => null, - Magento\Payment\Model\MethodList::class => null, - Magento\Quote\Model\PaymentMethodManagement::class => null, - Magento\Quote\Model\Quote\Interceptor::class => null, - Magento\Quote\Model\ResourceModel\Quote\Item\Collection\Interceptor::class => null, - Magento\User\Model\User\Interceptor::class => null, - Magento\Quote\Model\ShippingAssignment::class => null, - Magento\Quote\Model\Shipping::class => null, - Magento\Framework\ObjectManager\TMap::class => null, - Magento\Payment\Gateway\Config\ValueHandlerPool::class => null, - Magento\Payment\Model\Method\Adapter::class => null, - ], - '*' => [ - Magento\Framework\Model\ResourceModel\Db\VersionControl\Metadata::class => null, - Magento\Framework\Model\ResourceModel\Db\VersionControl\Snapshot::class => null, + Magento\TestFramework\Interception\PluginList::class => null, // memory leak, wrong sql, potential issues Magento\Framework\Event\Config\Data::class => null, @@ -1019,7 +326,6 @@ Magento\Framework\App\Cache\Type\FrontendPool::class => null, Magento\Framework\App\DeploymentConfig\Writer::class => null, Magento\Framework\App\Cache\State::class => null, - Magento\Framework\Module\ModuleList::class => null, Magento\RemoteStorage\Model\Config::class => null, Magento\Store\Model\Config\Processor\Fallback::class => null, Magento\Framework\Lock\LockBackendFactory::class => null, @@ -1077,7 +383,6 @@ Magento\Catalog\Model\ResourceModel\Product\Attribute\Collection::class => null, Magento\Framework\Url::class => null, Magento\Framework\HTTP\PhpEnvironment\RemoteAddress::class => null, - Magento\Framework\Module\ModuleList::class => null, Magento\Framework\Module\Manager::class => null, /* AddUserInfoToContext has userContext changed by Magento\GraphQl\Model\Query\ContextFactory, * but we need to make this more robust in secure in case of unforeseen bugs. @@ -1094,8 +399,10 @@ Magento\Indexer\Model\Indexer\DependencyDecorator::class => null, Magento\InventorySales\Model\IsProductSalableForRequestedQtyCondition\IsProductSalableForRequestedQtyConditionChain::class => null, Magento\InventorySales\Model\AreProductsSalableForRequestedQty::class => null, + Magento\Framework\Css\PreProcessor\Adapter\CssInliner::class => null, ], '*-fromConstructed' => [ + Magento\Framework\Css\PreProcessor\Adapter\CssInliner::class => null, Magento\GraphQl\App\State\ObjectManager::class => null, Magento\RemoteStorage\Filesystem::class => null, Magento\Framework\App\Cache\Frontend\Factory::class => null, @@ -1176,7 +483,6 @@ Magento\Customer\Model\Attribute\Interceptor::class => null, Magento\Framework\GraphQl\Schema\SchemaGenerator::class => null, Magento\Customer\Model\ResourceModel\Customer::class => null, - Magento\Framework\Model\ResourceModel\Db\VersionControl\Snapshot::class => null, Magento\Framework\App\PageCache\Version::class => null, Magento\Framework\App\PageCache\Identifier::class => null, Magento\Framework\App\PageCache\Kernel::class => null, From 35f3fb8e2c872d5bdf7cf5bc6781cfe4f62e63a2 Mon Sep 17 00:00:00 2001 From: Aakash Kumar Date: Mon, 16 Oct 2023 20:54:28 -0500 Subject: [PATCH 16/31] ACPT-1625 --- .../App/GraphQlCheckoutMutationsStateTest.php | 3 +- .../GraphQl/App/State/GraphQlStateDiff.php | 11 --- .../GraphQl/_files/state-skip-list.php | 80 +++---------------- 3 files changed, 13 insertions(+), 81 deletions(-) diff --git a/dev/tests/integration/testsuite/Magento/GraphQl/App/GraphQlCheckoutMutationsStateTest.php b/dev/tests/integration/testsuite/Magento/GraphQl/App/GraphQlCheckoutMutationsStateTest.php index 44bf5ed881dc1..7da4762283ac3 100644 --- a/dev/tests/integration/testsuite/Magento/GraphQl/App/GraphQlCheckoutMutationsStateTest.php +++ b/dev/tests/integration/testsuite/Magento/GraphQl/App/GraphQlCheckoutMutationsStateTest.php @@ -85,6 +85,7 @@ public function testAddSimpleProductToCart() * @magentoDataFixture Magento/GraphQl/Catalog/_files/simple_product.php * @magentoDataFixture Magento/GraphQl/Quote/_files/add_simple_product.php * @magentoDataFixture Magento/SalesRule/_files/coupon_code_with_wildcard.php + * @magentoDataFixture Magento/SalesRule/_files/coupon_cart_fixed_discount.php * @return void * @throws \Exception */ @@ -95,7 +96,7 @@ public function testAddCouponToCart() $this->graphQlStateDiff->testState( $query, ['cartId' => $cartId, 'couponCode' => '2?ds5!2d'], - [], + ['cartId' => $cartId, 'couponCode' => 'CART_FIXED_DISCOUNT_15'], [], 'applyCouponToCart', '"data":{"applyCouponToCart":', diff --git a/dev/tests/integration/testsuite/Magento/GraphQl/App/State/GraphQlStateDiff.php b/dev/tests/integration/testsuite/Magento/GraphQl/App/State/GraphQlStateDiff.php index 0924910d8747e..374410963188f 100644 --- a/dev/tests/integration/testsuite/Magento/GraphQl/App/State/GraphQlStateDiff.php +++ b/dev/tests/integration/testsuite/Magento/GraphQl/App/State/GraphQlStateDiff.php @@ -96,9 +96,6 @@ public function testState( foreach($variables as $cartId) { $this->reactivateCart($cartId); } - } - elseif ($operationName==='applyCouponToCart') { - $this->removeCouponFromCart($variables); } elseif ($operationName==='resetPassword') { $variables2['resetPasswordToken'] = $this->getResetPasswordToken($variables['email']); $variables2['email'] = $variables['email']; @@ -193,14 +190,6 @@ private function reactivateCart(string $cartId) $cart->setIsActive(true); $cart->save(); } - - private function removeCouponFromCart(array $variables) - { - $couponManagement = $this->objectManagerForTest->get(\Magento\Quote\Api\CouponManagementInterface::class); - $cartId = $this->getCartId($variables['cartId']); - $couponManagement->remove($cartId); - } - private function getCartId(string $cartId) { $maskedQuoteIdToQuoteId = $this->objectManagerForTest->get(MaskedQuoteIdToQuoteIdInterface::class); diff --git a/dev/tests/integration/testsuite/Magento/GraphQl/_files/state-skip-list.php b/dev/tests/integration/testsuite/Magento/GraphQl/_files/state-skip-list.php index f7b34f077c89a..5a1d8a4193270 100644 --- a/dev/tests/integration/testsuite/Magento/GraphQl/_files/state-skip-list.php +++ b/dev/tests/integration/testsuite/Magento/GraphQl/_files/state-skip-list.php @@ -28,16 +28,11 @@ 'resolveUrl' => [ Magento\Framework\GraphQl\Query\Fields::class => null, ], - 'createEmptyCart' => [ - Magento\Eav\Api\Data\AttributeExtensionFactory::class => null, - Magento\Eav\Model\Entity\Attribute\FrontendLabelFactory::class => null, - Magento\Eav\Model\Validator\Attribute\Code::class => null, - Magento\Catalog\Model\Product\ReservedAttributeList::class => null, - Magento\Catalog\Model\Product\ReservedAttributeCheckerAdapter::class => null, - Magento\Company\Model\ResourceModel\Company::class => null, - Magento\Company\Model\Company::class => null, - Magento\Company\Model\Company\ReservedAttributeList::class => null, - Magento\Eav\Model\ReservedAttributeChecker::class => null, + 'applyCouponToCart' => [ + Magento\SalesRule\Model\DeltaPriceRound::class => null, + Magento\SalesRule\Helper\CartFixedDiscount::class => null, + Magento\Quote\Model\ResourceModel\Collection\Interceptor::class => null, + Magento\Quote\Model\ResourceModel\Quote\Collection\Interceptor::class => null, ], 'addBundleProductsToCart' => [ Magento\Quote\Api\Data\ProductOptionInterfaceFactory::class => null, @@ -97,74 +92,16 @@ Magento\SalesRule\Api\Data\RuleSearchResultInterfaceFactory::class => null, Magento\SalesRule\Model\RuleRepository::class => null, Magento\Reward\Model\SalesRule\RewardPointCounter::class => null, - Magento\NegotiableQuote\Model\Restriction\Customer::class => null, - Magento\NegotiableQuote\Model\Restriction\Admin::class => null, - Magento\SharedCatalog\Plugin\Catalog\Model\ResourceModel\Product\Indexer\BaseFinalPricePlugin::class => null, ], 'createCustomer' => [ - Magento\Framework\Logger\LoggerProxy::class => null, - Magento\Customer\Model\GroupRegistry::class => null, Magento\TestFramework\Mail\Template\TransportBuilderMock::class => null, - Magento\Catalog\Helper\Product\Flat\Indexer::class => null, - Magento\Catalog\Helper\Product::class => null, - Magento\Framework\Url\Helper\Data::class => null, - Magento\Newsletter\Model\CustomerSubscriberCache::class => null, - Magento\Newsletter\Model\SubscriptionManager::class => null, Magento\LoginAsCustomerAssistance\Model\IsAssistanceEnabled::class => null, - Magento\Framework\MessageQueue\Publisher\Config\RemoteService\Reader::class => null, - Magento\Framework\Pricing\Helper\Data::class => null, - Magento\Catalog\Helper\Category::class => null, - Magento\Tax\Helper\Data::class => null, - Magento\Weee\Helper\Data::class => null, - Magento\Catalog\Helper\Product\Configuration::class => null, - Magento\Bundle\Helper\Catalog\Product\Configuration::class => null, - Magento\PageCache\Model\Cache\Server::class => null, - Magento\Catalog\Helper\Product\Edit\Action\Attribute::class => null, - Magento\Newsletter\Model\Plugin\CustomerPlugin::class => null, - Magento\Newsletter\Helper\Data::class => null, - Magento\Developer\Helper\Data::class => null, - Magento\Wishlist\Plugin\SaveWishlistDataAndAddReferenceKeyToBackUrl::class => null, - Magento\Framework\View\Page\Config\Generator\Head::class => null, - Magento\Store\Model\Argument\Interpreter\ServiceUrl::class => null, - Magento\Framework\View\Layout\Argument\Interpreter\Url::class => null, - Magento\Framework\Css\PreProcessor\Adapter\CssInliner::class => null, - Magento\Authorization\Model\UserContextInterface\Proxy::class => null, - Magento\Catalog\Controller\Adminhtml\Product\Initialization\Helper::class => null, - Magento\Framework\DataObject\Copy::class => null, - Magento\Quote\Model\Quote\Item\Processor::class => null, - Magento\Sales\Model\Config::class => null, - Magento\Customer\Model\Session\Storage::class => null, - Magento\Backend\Model\Session::class => null, - Magento\Quote\Model\ResourceModel\Quote\Item::class => null, - Magento\Backend\Model\Menu\Config::class => null, - Magento\Backend\Model\Url::class => null, Magento\Customer\Model\Indexer\AttributeProvider::class => null, - Magento\Framework\App\Cache\FlushCacheByTags::class => null, - Magento\Eav\Helper\Data::class => null, ], 'updateCustomer' => [ Magento\LoginAsCustomerAssistance\Model\SetAssistance::class => null, Magento\LoginAsCustomerAssistance\Plugin\CustomerPlugin::class => null, ], - 'updateCustomerAddress' => [ - Magento\Customer\Model\Metadata\AddressMetadata::class => null, - Magento\Customer\Model\Metadata\AddressCachedMetadata::class => null, - ], - 'updateCustomerEmail' => [ - Magento\GraphQlCache\Model\Plugin\Auth\TokenIssuer::class => null, - ], - 'getCart' => [ - Magento\Payment\Model\MethodList::class => null, - Magento\Quote\Model\PaymentMethodManagement::class => null, - Magento\Quote\Model\Quote\Interceptor::class => null, - Magento\Quote\Model\ResourceModel\Quote\Item\Collection\Interceptor::class => null, - Magento\User\Model\User\Interceptor::class => null, - Magento\Quote\Model\ShippingAssignment::class => null, - Magento\Quote\Model\Shipping::class => null, - Magento\Framework\ObjectManager\TMap::class => null, - Magento\Payment\Gateway\Config\ValueHandlerPool::class => null, - Magento\Payment\Model\Method\Adapter::class => null, - ], '*' => [ Magento\Quote\Model\Quote\Item\Interceptor::class => null, Magento\Framework\Stdlib\ArrayManager::class => null, @@ -174,7 +111,6 @@ Magento\Quote\Model\ResourceModel\Quote::class => null, Magento\Customer\Model\ResourceModel\Attribute::class => null, Magento\Quote\Model\QuoteIdToMaskedQuoteId::class => null, - Magento\GraphQl\Quote\GetMaskedQuoteIdByReservedOrderId::class => null, Magento\Framework\Reflection\MethodsMap::class => null, Magento\Framework\Reflection\DataObjectProcessor::class => null, Magento\Catalog\Model\ResourceModel\Product::class => null, @@ -400,6 +336,7 @@ Magento\InventorySales\Model\IsProductSalableForRequestedQtyCondition\IsProductSalableForRequestedQtyConditionChain::class => null, Magento\InventorySales\Model\AreProductsSalableForRequestedQty::class => null, Magento\Framework\Css\PreProcessor\Adapter\CssInliner::class => null, + Magento\Customer\Model\GroupRegistry::class => null, ], '*-fromConstructed' => [ Magento\Framework\Css\PreProcessor\Adapter\CssInliner::class => null, @@ -716,6 +653,11 @@ Magento\SalesRule\Model\Service\CouponUsagePublisher::class => null, Magento\Paypal\Model\Api\Nvp\Interceptor::class => null, Magento\PurchaseOrder\Model\PurchaseOrder\LogManagement::class => null, + Magento\Quote\Model\ResourceModel\Collection\Interceptor::class => null, + + //Update Customer Address + Magento\Customer\Model\Metadata\AddressMetadata::class => null, + Magento\Customer\Model\Metadata\AddressCachedMetadata::class => null, ], '' => [ ], From 450adf79ed7c65a9a54cda15baea09b6b47d2be7 Mon Sep 17 00:00:00 2001 From: Aakash Kumar Date: Tue, 24 Oct 2023 22:15:47 -0500 Subject: [PATCH 17/31] ACPT-1625 --- .../App/GraphQlCustomerMutationsTest.php | 14 +- .../GraphQl/App/State/ObjectManager.php | 210 +++++++++++++++++- .../Quote/_files/add_simple_product.php | 6 + .../_files/customer/create_empty_carts.php | 40 ++++ .../GraphQl/_files/state-skip-list.php | 3 + 5 files changed, 268 insertions(+), 5 deletions(-) create mode 100644 dev/tests/integration/testsuite/Magento/GraphQl/Quote/_files/customer/create_empty_carts.php diff --git a/dev/tests/integration/testsuite/Magento/GraphQl/App/GraphQlCustomerMutationsTest.php b/dev/tests/integration/testsuite/Magento/GraphQl/App/GraphQlCustomerMutationsTest.php index d24cd88e0ebd0..1218afed4d3b3 100644 --- a/dev/tests/integration/testsuite/Magento/GraphQl/App/GraphQlCustomerMutationsTest.php +++ b/dev/tests/integration/testsuite/Magento/GraphQl/App/GraphQlCustomerMutationsTest.php @@ -88,22 +88,28 @@ private function clearCustomerBeforeTest(array $emails): void } /** + * * @magentoDataFixture Magento/Checkout/_files/quote_with_virtual_product_saved.php - * @magentoDataFixture Magento/Customer/_files/customer.php + * @magentoDataFixture Magento/Checkout/_files/customers.php * @magentoDataFixture Magento/GraphQl/Catalog/_files/simple_product.php - * @magentoDataFixture Magento/GraphQl/Quote/_files/customer/create_empty_cart.php + * @magentoDataFixture Magento/GraphQl/Quote/_files/customer/create_empty_carts.php * @magentoDataFixture Magento/GraphQl/Quote/_files/add_simple_product.php */ public function testMergeCarts(): void { $cartId1 = $this->graphQlStateDiff->getCartIdHash('test_order_with_virtual_product_without_address'); $cartId2 = $this->graphQlStateDiff->getCartIdHash('test_quote'); + $cartId3 = $this->graphQlStateDiff->getCartIdHash('test_quote2'); $query = $this->getCartMergeMutation(); $this->graphQlStateDiff->testState( $query, ['cartId1' => $cartId1, 'cartId2' => $cartId2], - [], - ['email' => 'customer@example.com', 'password' => 'password'], + ['cartId1' => $cartId1, 'cartId2' => $cartId3], + [ + ['email' => 'customer1@example.com', 'password' => 'password'], + ['email' => 'customer2@example.com', 'password' => 'password'], + + ], 'mergeCarts', '"data":{"mergeCarts":', $this diff --git a/dev/tests/integration/testsuite/Magento/GraphQl/App/State/ObjectManager.php b/dev/tests/integration/testsuite/Magento/GraphQl/App/State/ObjectManager.php index fa204ed8d9d7b..1a56a200605ea 100644 --- a/dev/tests/integration/testsuite/Magento/GraphQl/App/State/ObjectManager.php +++ b/dev/tests/integration/testsuite/Magento/GraphQl/App/State/ObjectManager.php @@ -7,6 +7,7 @@ namespace Magento\GraphQl\App\State; +use Magento\Framework\Event\ObserverFactory; use Magento\Framework\ObjectManager\ResetAfterRequestInterface; use Magento\TestFramework\ObjectManager as TestFrameworkObjectManager; use Weakmap; @@ -21,16 +22,223 @@ class ObjectManager extends TestFrameworkObjectManager * * @param TestFrameworkObjectManager $testFrameworkObjectManager */ + private $bootstrappedObjects = [ + 'Magento\Framework\App\Filesystem\DirectoryList', + 'Magento\Framework\App\DeploymentConfig', + 'Magento\Framework\Filesystem\DirectoryList', + 'Magento\Framework\Filesystem\DriverPool', + 'Magento\Framework\ObjectManager\RelationsInterface', + 'Magento\Framework\Interception\DefinitionInterface', + 'Magento\Framework\ObjectManager\ConfigInterface', + 'Magento\Framework\Interception\ObjectManager\ConfigInterface', + 'Magento\Framework\ObjectManager\DefinitionInterface', + 'Magento\Framework\Stdlib\BooleanUtils', + 'Magento\Framework\ObjectManager\Config\Mapper\Dom', + 'Magento\Framework\ObjectManager\ConfigLoaderInterface', + 'Magento\TestFramework\ObjectManager\Config', + 'Magento\Framework\ObjectManagerInterface', + 'Magento\RemoteStorage\Model\Config', + 'Magento\RemoteStorage\Driver\Adapter\MetadataProviderInterfaceFactory', + 'Magento\RemoteStorage\Driver\Adapter\Cache\CacheInterfaceFactory', + 'Magento\RemoteStorage\Driver\Adapter\CachedAdapterInterfaceFactory', + 'Magento\Framework\App\Cache\Proxy', + 'Aws\Credentials\CredentialsFactory', + 'Magento\Framework\Serialize\Serializer\Json', + 'Magento\AwsS3\Driver\CredentialsCache', + 'Magento\AwsS3\Driver\CachedCredentialsProvider', + 'Magento\AwsS3\Driver\AwsS3Factory', + 'Magento\RemoteStorage\Driver\DriverFactoryPool', + 'Magento\RemoteStorage\Driver\DriverPool', + 'remoteReadFactory', + 'Magento\RemoteStorage\Model\Filesystem\Directory\WriteFactory', + 'customRemoteFilesystem', + 'Magento\Framework\App\ResourceConnection\Proxy', + 'Magento\Framework\App\Cache\Frontend\Factory', + 'Magento\Framework\App\Cache\Frontend\Pool', + 'Magento\Framework\App\Cache\Type\FrontendPool', + 'Magento\Framework\App\Cache\Type\Config', + 'Magento\Framework\ObjectManager\Config\Reader\DomFactory', + 'Magento\Framework\Serialize\Serializer\Serialize', + 'Magento\Framework\App\ObjectManager\ConfigLoader', + 'Magento\Framework\Filesystem\Directory\ReadFactory', + 'Magento\Framework\Filesystem\Directory\WriteFactory', + 'Magento\TestFramework\App\Filesystem', + 'Magento\Framework\Filesystem', + 'Magento\Framework\Filesystem\Driver\File', + 'Magento\Framework\App\AreaList\Proxy', + 'Magento\Framework\Config\Scope', + 'Magento\Framework\ObjectManager\Config\Reader\Dom\Proxy', + 'Psr\Log\LoggerInterface\Proxy', + 'Magento\Framework\Interception\PluginListGenerator', + 'Magento\TestFramework\Interception\PluginList', + 'Magento\Framework\App\State', + 'Magento\Framework\Logger\LoggerProxy', + 'Magento\TestFramework\ErrorLog\Logger', + 'Magento\Framework\App\ResourceConnection\Config\Reader\Proxy', + 'Magento\Framework\App\Cache\Type\Config\Proxy', + 'Magento\Framework\App\ResourceConnection\Config', + 'Magento\Framework\App\ResourceConnection\ConnectionFactory', + 'Magento\Framework\Config\File\ConfigFilePool', + 'Magento\Framework\App\DeploymentConfig\Reader', + 'Magento\Framework\Stdlib\Cookie\PhpCookieReader', + 'Magento\Framework\Stdlib\StringUtils', + 'Magento\Framework\App\Route\ConfigInterface\Proxy', + 'Magento\Backend\App\Request\PathInfoProcessor\Proxy', + 'Magento\Framework\App\Request\PathInfo', + 'Magento\TestFramework\Request', + 'Magento\ResourceConnections\App\DeploymentConfig', + 'Magento\Framework\App\ResourceConnection', + 'Magento\Framework\Model\ResourceModel\Db\TransactionManager', + 'Magento\Framework\Model\ResourceModel\Db\ObjectRelationProcessor', + 'Magento\Framework\Model\ResourceModel\Db\Context', + 'Magento\SalesSequence\Model\MetaFactory', + 'Magento\SalesSequence\Model\ProfileFactory', + 'Magento\SalesSequence\Model\ResourceModel\Profile', + 'Magento\SalesSequence\Model\ResourceModel\Meta', + 'Magento\Framework\DB\Ddl\Sequence', + 'Magento\TestFramework\Db\Sequence\Builder', + 'Magento\SalesSequence\Model\Builder', + 'Magento\Framework\Event\Config\Reader\Proxy', + 'Magento\Framework\Event\Config\Data', + 'Magento\Framework\App\Request\Http\Proxy', + 'Magento\Framework\Cache\InvalidateLogger', + 'Magento\Framework\App\DeploymentConfig\Writer', + 'Magento\Framework\App\Cache\State', + 'Magento\Framework\App\Area\FrontNameResolverFactory', +// 'Magento\Framework\App\AreaList', + 'Magento\Staging\Model\Event\Manager\Proxy', + 'Magento\Theme\Model\View\Design\Proxy', + 'Magento\Framework\App\Cache\Type\Translate', + 'Magento\Framework\View\Design\Fallback\Rule\SimpleFactory', + 'Magento\Framework\View\Design\Fallback\Rule\ThemeFactory', + 'Magento\Framework\View\Design\Fallback\Rule\ModuleFactory', + 'Magento\Framework\View\Design\Fallback\Rule\ModularSwitchFactory', + 'Magento\Framework\View\Design\Fallback\RulePool', + 'Magento\Framework\View\Design\FileResolution\Fallback\Resolver\Simple', + 'Magento\Framework\View\Design\FileResolution\Fallback\File', + 'Magento\Framework\View\Template\Html\Minifier', + 'Magento\TestFramework\App\State', + 'Magento\Framework\App\ScopeResolver', + 'Magento\Store\Model\StoreManagerInterface\Proxy', + 'Magento\Store\Model\Resolver\Store', + 'Magento\Store\Model\Resolver\Group', + 'Magento\Store\Model\Resolver\Website', + 'Magento\Framework\App\ScopeResolverPool', + 'Magento\Framework\App\Config\ScopeCodeResolver', + 'scopesConfigSourceAggregatedProxy', + 'Magento\Store\App\Config\Type\Scopes', + 'systemConfigSourceAggregatedProxy', + 'systemConfigPostProcessorCompositeProxy', + 'Magento\Store\Model\ResourceModel\Store', + 'Magento\Store\Model\ResourceModel\Website', + 'Magento\Store\Model\Config\Processor\Fallback', + 'Magento\Theme\Model\Config\Processor\DesignTheme\Proxy', + 'Magento\Config\Model\Placeholder\PlaceholderFactory', + 'Magento\Framework\Stdlib\ArrayManager', + 'Magento\Config\Model\Config\Processor\EnvironmentPlaceholder', + 'Magento\Framework\App\Config\PreProcessorComposite', + 'Magento\Config\App\Config\Type\System\Reader\Proxy', + 'Magento\Framework\Lock\LockBackendFactory', + 'Magento\Framework\Lock\Proxy', + 'systemConfigQueryLocker', + 'Magento\Framework\Math\Random', + 'Magento\Framework\Encryption\KeyValidator', + 'Magento\Framework\Encryption\Encryptor', + 'Magento\Config\App\Config\Type\System', + 'Magento\Translation\Model\Source\InitialTranslationSource\Proxy', + 'translationConfigInitialDataProvider', + 'translationConfigSourceAggregated', + 'Magento\Translation\App\Config\Type\Translation', + 'Magento\TestFramework\App\Config', + 'Magento\Framework\View\Asset\Config', + 'Magento\Framework\View\Design\FileResolution\Fallback\TemplateFile', + 'Magento\Framework\View\Design\FileResolution\Fallback\LocaleFile', + 'viewFileFallbackResolver', + 'Magento\Framework\View\Asset\Minification', + 'viewFileMinifiedFallbackResolver', + 'Magento\Framework\View\Design\FileResolution\Fallback\StaticFile', + 'Magento\Framework\View\Design\FileResolution\Fallback\EmailTemplateFile', + 'Magento\Framework\App\Route\Config\Reader\Proxy', + 'Magento\Framework\App\Route\Config', + 'Magento\Framework\Url\SecurityInfo\Proxy', + 'Magento\Framework\Url\ScopeResolver', + 'Magento\Framework\Session\Generic\Proxy', + 'Magento\Framework\Session\SidResolver\Proxy', + 'Magento\Framework\Url\RouteParamsResolverFactory', + 'Magento\Framework\Url\QueryParamsResolver', + 'Magento\Staging\Model\VersionManager\Proxy', + 'Magento\Staging\Model\Preview\RequestSigner\Proxy', + 'Magento\Staging\Model\Preview\RouteParamsPreprocessor', + 'Magento\Framework\Url\RouteParamsPreprocessorComposite', + 'Magento\Framework\Url\HostChecker', + 'Magento\Framework\Url', + 'Magento\Framework\Data\Collection\EntityFactory', + 'Magento\Framework\Config\ThemeFactory', + 'Magento\Framework\Component\ComponentRegistrar', + 'Magento\Framework\View\Design\Theme\ThemePackageFactory', + 'Magento\Framework\View\Design\Theme\ThemePackageList', + 'Magento\Theme\Model\Theme\Collection', + 'Magento\Framework\View\Asset\PreProcessor\Helper\Sort', + 'AssetPreProcessorPool', + 'Magento\Framework\View\Asset\PreProcessor\ChainFactory', + 'Magento\Framework\View\Asset\Source', + 'Magento\Framework\View\Asset\FileFactory', + 'Magento\Framework\View\Asset\File\FallbackContextFactory', + 'Magento\Framework\View\Asset\File\ContextFactory', + 'Magento\Framework\View\Asset\RemoteFactory', + 'Magento\Framework\View\Asset\Repository', + 'Magento\Framework\View\FileSystem', + 'Magento\Framework\Module\Declaration\Converter\Dom', + 'Magento\Framework\Module\ModuleList\Loader', + 'Magento\Framework\Module\ModuleList', + 'Magento\Framework\Module\Dir', + 'Magento\Framework\Filesystem\File\ReadFactory', + 'Magento\Framework\Config\FileIteratorFactory', + 'Magento\Framework\Module\Dir\Reader', + 'Magento\Framework\Translate\ResourceInterface\Proxy', + 'Magento\Framework\Locale\Resolver\Proxy', + 'Magento\Framework\File\Csv', + 'Magento\Framework\App\Language\ConfigFactory', + 'Magento\Framework\App\Language\ConfigFactory', + 'Magento\Framework\Translate', + 'Magento\Theme\Model\Design\Proxy', + 'Magento\Framework\View\DesignExceptions', + 'Magento\TestFramework\ObjectManager\Configurator', + 'Magento\Framework\Phrase\Renderer\Placeholder', + 'Magento\SalesSequence\Model\EntityPool', + 'Magento\TestFramework\Db\Sequence', + 'Magento\Framework\DB\Adapter\Pdo\MysqlFactory', + 'Magento\Framework\DB\Logger\FileFactory', + 'Magento\Framework\DB\Logger\QuietFactory', + 'Magento\Framework\DB\Logger\LoggerProxy', + 'Magento\Framework\DB\Select\RendererProxy', + 'Magento\Framework\DB\SelectFactory', + 'Magento\Framework\Stdlib\DateTime', + 'Magento\Framework\DB\Adapter\DdlCache', + ]; public function __construct(TestFrameworkObjectManager $testFrameworkObjectManager) { /* Note: PHP doesn't have copy constructors, so we have to use get_object_vars, * but luckily all the properties in the superclass are protected. */ $properties = get_object_vars($testFrameworkObjectManager); foreach ($properties as $key => $value) { - $this->$key = $value; + if ($key=== '_sharedInstances') { + foreach($value as $class => $instance) { + if (in_array($class, $this->bootstrappedObjects)) { + $this->_sharedInstances[$class] = $instance; + } + } + } else { + $this->$key = $value; + } + } +// unset($this->_sharedInstances['Magento\Framework\Event\ObserverFactory']); $this->_sharedInstances['Magento\Framework\ObjectManagerInterface'] = $this; $this->_sharedInstances['Magento\Framework\App\ObjectManager'] = $this; +// unset($this->_sharedInstances['Magento\Framework\App\AreaList']); +// unset($testFrameworkObjectManager->_sharedInstances['Magento\Framework\App\AreaList']); + unset($this->_sharedInstances['Magento\Staging\Model\Event\Manager\Proxy']); unset($this->_sharedInstances['Magento\Framework\Interception\PluginListInterface']); unset($this->_sharedInstances['Magento\TestFramework\Interception\PluginList']); $this->_factory = new DynamicFactoryDecorator($this->_factory, $this); diff --git a/dev/tests/integration/testsuite/Magento/GraphQl/Quote/_files/add_simple_product.php b/dev/tests/integration/testsuite/Magento/GraphQl/Quote/_files/add_simple_product.php index f62b463d94003..7a83cd5395698 100644 --- a/dev/tests/integration/testsuite/Magento/GraphQl/Quote/_files/add_simple_product.php +++ b/dev/tests/integration/testsuite/Magento/GraphQl/Quote/_files/add_simple_product.php @@ -26,3 +26,9 @@ $quoteResource->load($quote, 'test_quote', 'reserved_order_id'); $quote->addProduct($product, 2); $cartRepository->save($quote); + + +$quote = $quoteFactory->create(); +$quoteResource->load($quote, 'test_quote2', 'reserved_order_id'); +$quote->addProduct($product, 2); +$cartRepository->save($quote); diff --git a/dev/tests/integration/testsuite/Magento/GraphQl/Quote/_files/customer/create_empty_carts.php b/dev/tests/integration/testsuite/Magento/GraphQl/Quote/_files/customer/create_empty_carts.php new file mode 100644 index 0000000000000..95bab71ca70b0 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/GraphQl/Quote/_files/customer/create_empty_carts.php @@ -0,0 +1,40 @@ +get(CartManagementInterface::class); +/** @var CartRepositoryInterface $cartRepository */ +$cartRepository = Bootstrap::getObjectManager()->get(CartRepositoryInterface::class); +/** @var QuoteIdMaskFactory $quoteIdMaskFactory */ +$quoteIdMaskFactory = Bootstrap::getObjectManager()->get(QuoteIdMaskFactory::class); + +$cartId = $cartManagement->createEmptyCartForCustomer(1); +$cart = $cartRepository->get($cartId); +$cart->setReservedOrderId('test_quote'); +$cartRepository->save($cart); + +/** @var QuoteIdMask $quoteIdMask */ +$quoteIdMask = $quoteIdMaskFactory->create(); +$quoteIdMask->setQuoteId($cartId) + ->save(); + +$cartId = $cartManagement->createEmptyCartForCustomer(2); +$cart = $cartRepository->get($cartId); +$cart->setReservedOrderId('test_quote2'); +$cart->setIsActive(true); +$cartRepository->save($cart); + +/** @var QuoteIdMask $quoteIdMask */ +$quoteIdMask = $quoteIdMaskFactory->create(); +$quoteIdMask->setQuoteId($cartId) + ->save(); diff --git a/dev/tests/integration/testsuite/Magento/GraphQl/_files/state-skip-list.php b/dev/tests/integration/testsuite/Magento/GraphQl/_files/state-skip-list.php index 5a1d8a4193270..82a43cf753610 100644 --- a/dev/tests/integration/testsuite/Magento/GraphQl/_files/state-skip-list.php +++ b/dev/tests/integration/testsuite/Magento/GraphQl/_files/state-skip-list.php @@ -658,6 +658,9 @@ //Update Customer Address Magento\Customer\Model\Metadata\AddressMetadata::class => null, Magento\Customer\Model\Metadata\AddressCachedMetadata::class => null, + + Magento\Reward\Model\Reward::class => null, + Magento\Reward\Model\Reward\Rate::class => null ], '' => [ ], From 670a0e2f0b770cb7b29de859ff05687823077060 Mon Sep 17 00:00:00 2001 From: Aakash Kumar Date: Mon, 16 Oct 2023 20:54:28 -0500 Subject: [PATCH 18/31] ACPT-1625 --- .../App/GraphQlCheckoutMutationsStateTest.php | 3 +- .../GraphQl/App/State/GraphQlStateDiff.php | 11 --- .../GraphQl/_files/state-skip-list.php | 80 +++---------------- 3 files changed, 13 insertions(+), 81 deletions(-) diff --git a/dev/tests/integration/testsuite/Magento/GraphQl/App/GraphQlCheckoutMutationsStateTest.php b/dev/tests/integration/testsuite/Magento/GraphQl/App/GraphQlCheckoutMutationsStateTest.php index 44bf5ed881dc1..7da4762283ac3 100644 --- a/dev/tests/integration/testsuite/Magento/GraphQl/App/GraphQlCheckoutMutationsStateTest.php +++ b/dev/tests/integration/testsuite/Magento/GraphQl/App/GraphQlCheckoutMutationsStateTest.php @@ -85,6 +85,7 @@ public function testAddSimpleProductToCart() * @magentoDataFixture Magento/GraphQl/Catalog/_files/simple_product.php * @magentoDataFixture Magento/GraphQl/Quote/_files/add_simple_product.php * @magentoDataFixture Magento/SalesRule/_files/coupon_code_with_wildcard.php + * @magentoDataFixture Magento/SalesRule/_files/coupon_cart_fixed_discount.php * @return void * @throws \Exception */ @@ -95,7 +96,7 @@ public function testAddCouponToCart() $this->graphQlStateDiff->testState( $query, ['cartId' => $cartId, 'couponCode' => '2?ds5!2d'], - [], + ['cartId' => $cartId, 'couponCode' => 'CART_FIXED_DISCOUNT_15'], [], 'applyCouponToCart', '"data":{"applyCouponToCart":', diff --git a/dev/tests/integration/testsuite/Magento/GraphQl/App/State/GraphQlStateDiff.php b/dev/tests/integration/testsuite/Magento/GraphQl/App/State/GraphQlStateDiff.php index 0924910d8747e..374410963188f 100644 --- a/dev/tests/integration/testsuite/Magento/GraphQl/App/State/GraphQlStateDiff.php +++ b/dev/tests/integration/testsuite/Magento/GraphQl/App/State/GraphQlStateDiff.php @@ -96,9 +96,6 @@ public function testState( foreach($variables as $cartId) { $this->reactivateCart($cartId); } - } - elseif ($operationName==='applyCouponToCart') { - $this->removeCouponFromCart($variables); } elseif ($operationName==='resetPassword') { $variables2['resetPasswordToken'] = $this->getResetPasswordToken($variables['email']); $variables2['email'] = $variables['email']; @@ -193,14 +190,6 @@ private function reactivateCart(string $cartId) $cart->setIsActive(true); $cart->save(); } - - private function removeCouponFromCart(array $variables) - { - $couponManagement = $this->objectManagerForTest->get(\Magento\Quote\Api\CouponManagementInterface::class); - $cartId = $this->getCartId($variables['cartId']); - $couponManagement->remove($cartId); - } - private function getCartId(string $cartId) { $maskedQuoteIdToQuoteId = $this->objectManagerForTest->get(MaskedQuoteIdToQuoteIdInterface::class); diff --git a/dev/tests/integration/testsuite/Magento/GraphQl/_files/state-skip-list.php b/dev/tests/integration/testsuite/Magento/GraphQl/_files/state-skip-list.php index f7b34f077c89a..5a1d8a4193270 100644 --- a/dev/tests/integration/testsuite/Magento/GraphQl/_files/state-skip-list.php +++ b/dev/tests/integration/testsuite/Magento/GraphQl/_files/state-skip-list.php @@ -28,16 +28,11 @@ 'resolveUrl' => [ Magento\Framework\GraphQl\Query\Fields::class => null, ], - 'createEmptyCart' => [ - Magento\Eav\Api\Data\AttributeExtensionFactory::class => null, - Magento\Eav\Model\Entity\Attribute\FrontendLabelFactory::class => null, - Magento\Eav\Model\Validator\Attribute\Code::class => null, - Magento\Catalog\Model\Product\ReservedAttributeList::class => null, - Magento\Catalog\Model\Product\ReservedAttributeCheckerAdapter::class => null, - Magento\Company\Model\ResourceModel\Company::class => null, - Magento\Company\Model\Company::class => null, - Magento\Company\Model\Company\ReservedAttributeList::class => null, - Magento\Eav\Model\ReservedAttributeChecker::class => null, + 'applyCouponToCart' => [ + Magento\SalesRule\Model\DeltaPriceRound::class => null, + Magento\SalesRule\Helper\CartFixedDiscount::class => null, + Magento\Quote\Model\ResourceModel\Collection\Interceptor::class => null, + Magento\Quote\Model\ResourceModel\Quote\Collection\Interceptor::class => null, ], 'addBundleProductsToCart' => [ Magento\Quote\Api\Data\ProductOptionInterfaceFactory::class => null, @@ -97,74 +92,16 @@ Magento\SalesRule\Api\Data\RuleSearchResultInterfaceFactory::class => null, Magento\SalesRule\Model\RuleRepository::class => null, Magento\Reward\Model\SalesRule\RewardPointCounter::class => null, - Magento\NegotiableQuote\Model\Restriction\Customer::class => null, - Magento\NegotiableQuote\Model\Restriction\Admin::class => null, - Magento\SharedCatalog\Plugin\Catalog\Model\ResourceModel\Product\Indexer\BaseFinalPricePlugin::class => null, ], 'createCustomer' => [ - Magento\Framework\Logger\LoggerProxy::class => null, - Magento\Customer\Model\GroupRegistry::class => null, Magento\TestFramework\Mail\Template\TransportBuilderMock::class => null, - Magento\Catalog\Helper\Product\Flat\Indexer::class => null, - Magento\Catalog\Helper\Product::class => null, - Magento\Framework\Url\Helper\Data::class => null, - Magento\Newsletter\Model\CustomerSubscriberCache::class => null, - Magento\Newsletter\Model\SubscriptionManager::class => null, Magento\LoginAsCustomerAssistance\Model\IsAssistanceEnabled::class => null, - Magento\Framework\MessageQueue\Publisher\Config\RemoteService\Reader::class => null, - Magento\Framework\Pricing\Helper\Data::class => null, - Magento\Catalog\Helper\Category::class => null, - Magento\Tax\Helper\Data::class => null, - Magento\Weee\Helper\Data::class => null, - Magento\Catalog\Helper\Product\Configuration::class => null, - Magento\Bundle\Helper\Catalog\Product\Configuration::class => null, - Magento\PageCache\Model\Cache\Server::class => null, - Magento\Catalog\Helper\Product\Edit\Action\Attribute::class => null, - Magento\Newsletter\Model\Plugin\CustomerPlugin::class => null, - Magento\Newsletter\Helper\Data::class => null, - Magento\Developer\Helper\Data::class => null, - Magento\Wishlist\Plugin\SaveWishlistDataAndAddReferenceKeyToBackUrl::class => null, - Magento\Framework\View\Page\Config\Generator\Head::class => null, - Magento\Store\Model\Argument\Interpreter\ServiceUrl::class => null, - Magento\Framework\View\Layout\Argument\Interpreter\Url::class => null, - Magento\Framework\Css\PreProcessor\Adapter\CssInliner::class => null, - Magento\Authorization\Model\UserContextInterface\Proxy::class => null, - Magento\Catalog\Controller\Adminhtml\Product\Initialization\Helper::class => null, - Magento\Framework\DataObject\Copy::class => null, - Magento\Quote\Model\Quote\Item\Processor::class => null, - Magento\Sales\Model\Config::class => null, - Magento\Customer\Model\Session\Storage::class => null, - Magento\Backend\Model\Session::class => null, - Magento\Quote\Model\ResourceModel\Quote\Item::class => null, - Magento\Backend\Model\Menu\Config::class => null, - Magento\Backend\Model\Url::class => null, Magento\Customer\Model\Indexer\AttributeProvider::class => null, - Magento\Framework\App\Cache\FlushCacheByTags::class => null, - Magento\Eav\Helper\Data::class => null, ], 'updateCustomer' => [ Magento\LoginAsCustomerAssistance\Model\SetAssistance::class => null, Magento\LoginAsCustomerAssistance\Plugin\CustomerPlugin::class => null, ], - 'updateCustomerAddress' => [ - Magento\Customer\Model\Metadata\AddressMetadata::class => null, - Magento\Customer\Model\Metadata\AddressCachedMetadata::class => null, - ], - 'updateCustomerEmail' => [ - Magento\GraphQlCache\Model\Plugin\Auth\TokenIssuer::class => null, - ], - 'getCart' => [ - Magento\Payment\Model\MethodList::class => null, - Magento\Quote\Model\PaymentMethodManagement::class => null, - Magento\Quote\Model\Quote\Interceptor::class => null, - Magento\Quote\Model\ResourceModel\Quote\Item\Collection\Interceptor::class => null, - Magento\User\Model\User\Interceptor::class => null, - Magento\Quote\Model\ShippingAssignment::class => null, - Magento\Quote\Model\Shipping::class => null, - Magento\Framework\ObjectManager\TMap::class => null, - Magento\Payment\Gateway\Config\ValueHandlerPool::class => null, - Magento\Payment\Model\Method\Adapter::class => null, - ], '*' => [ Magento\Quote\Model\Quote\Item\Interceptor::class => null, Magento\Framework\Stdlib\ArrayManager::class => null, @@ -174,7 +111,6 @@ Magento\Quote\Model\ResourceModel\Quote::class => null, Magento\Customer\Model\ResourceModel\Attribute::class => null, Magento\Quote\Model\QuoteIdToMaskedQuoteId::class => null, - Magento\GraphQl\Quote\GetMaskedQuoteIdByReservedOrderId::class => null, Magento\Framework\Reflection\MethodsMap::class => null, Magento\Framework\Reflection\DataObjectProcessor::class => null, Magento\Catalog\Model\ResourceModel\Product::class => null, @@ -400,6 +336,7 @@ Magento\InventorySales\Model\IsProductSalableForRequestedQtyCondition\IsProductSalableForRequestedQtyConditionChain::class => null, Magento\InventorySales\Model\AreProductsSalableForRequestedQty::class => null, Magento\Framework\Css\PreProcessor\Adapter\CssInliner::class => null, + Magento\Customer\Model\GroupRegistry::class => null, ], '*-fromConstructed' => [ Magento\Framework\Css\PreProcessor\Adapter\CssInliner::class => null, @@ -716,6 +653,11 @@ Magento\SalesRule\Model\Service\CouponUsagePublisher::class => null, Magento\Paypal\Model\Api\Nvp\Interceptor::class => null, Magento\PurchaseOrder\Model\PurchaseOrder\LogManagement::class => null, + Magento\Quote\Model\ResourceModel\Collection\Interceptor::class => null, + + //Update Customer Address + Magento\Customer\Model\Metadata\AddressMetadata::class => null, + Magento\Customer\Model\Metadata\AddressCachedMetadata::class => null, ], '' => [ ], From 1dfe8c339588b5ffe9981d2940e417f72f764ae0 Mon Sep 17 00:00:00 2001 From: Jacob Brown Date: Wed, 25 Oct 2023 13:16:36 -0500 Subject: [PATCH 19/31] Fixing issues with GraphQlStateDiff and its ObjectManager * For _sharedInstances, using only objects after ObjectManager's factory has finished building it, and those added by addSharedInstance * GraphQlStateDiff using proper request object (RequestInterface from _sharedInstances) --- .../GraphQl/App/State/GraphQlStateDiff.php | 9 +- .../GraphQl/App/State/ObjectManager.php | 255 +++++------------- 2 files changed, 66 insertions(+), 198 deletions(-) diff --git a/dev/tests/integration/testsuite/Magento/GraphQl/App/State/GraphQlStateDiff.php b/dev/tests/integration/testsuite/Magento/GraphQl/App/State/GraphQlStateDiff.php index 374410963188f..140bcae981842 100644 --- a/dev/tests/integration/testsuite/Magento/GraphQl/App/State/GraphQlStateDiff.php +++ b/dev/tests/integration/testsuite/Magento/GraphQl/App/State/GraphQlStateDiff.php @@ -12,7 +12,7 @@ use Magento\Customer\Model\CustomerRegistry; use Magento\Framework\App\Http as HttpApp; use Magento\Framework\App\ObjectManager as AppObjectManager; -use Magento\Framework\App\Request\HttpFactory as RequestFactory; +use Magento\Framework\App\RequestInterface; use Magento\Framework\App\Response\Http as HttpResponse; use Magento\Framework\Exception\LocalizedException; use Magento\Framework\Exception\NoSuchEntityException; @@ -41,10 +41,6 @@ class GraphQlStateDiff /** @var Comparator */ private Comparator $comparator; - /** @var RequestFactory */ - private RequestFactory $requestFactory; - - public function __construct() { $this->objectManagerBeforeTest = Bootstrap::getObjectManager(); @@ -53,7 +49,6 @@ public function __construct() AppObjectManager::setInstance($this->objectManagerForTest); Bootstrap::setObjectManager($this->objectManagerForTest); $this->comparator = $this->objectManagerForTest->create(Comparator::class); - $this->requestFactory = $this->objectManagerForTest->get(RequestFactory::class); $this->objectManagerForTest->resetStateSharedInstances(); } @@ -157,7 +152,7 @@ private function request(string $query, string $operationName, array $authInfo, */ private function doRequest(string $query, array $authInfo) { - $request = $this->requestFactory->create(); + $request = $this->objectManagerForTest->get(RequestInterface::class); $request->setContent($query); $request->setMethod('POST'); $request->setPathInfo('/graphql'); diff --git a/dev/tests/integration/testsuite/Magento/GraphQl/App/State/ObjectManager.php b/dev/tests/integration/testsuite/Magento/GraphQl/App/State/ObjectManager.php index 1a56a200605ea..e681f81c3fcd7 100644 --- a/dev/tests/integration/testsuite/Magento/GraphQl/App/State/ObjectManager.php +++ b/dev/tests/integration/testsuite/Magento/GraphQl/App/State/ObjectManager.php @@ -23,198 +23,77 @@ class ObjectManager extends TestFrameworkObjectManager * @param TestFrameworkObjectManager $testFrameworkObjectManager */ private $bootstrappedObjects = [ + // Note: These are after $objectManager = $this->_factory->create($overriddenParams); + 'Magento\\Framework\\App\\DeploymentConfig', + 'Magento\\Framework\\App\\Filesystem\\DirectoryList', + 'Magento\\Framework\\Filesystem\\DirectoryList', + 'Magento\\Framework\\Filesystem\\DriverPool', + 'Magento\\Framework\\ObjectManager\\RelationsInterface', + 'Magento\\Framework\\Interception\\DefinitionInterface', + 'Magento\\Framework\\ObjectManager\\ConfigInterface', + 'Magento\\Framework\\Interception\\ObjectManager\\ConfigInterface', + 'Magento\\Framework\\ObjectManager\\DefinitionInterface', + 'Magento\\Framework\\Stdlib\\BooleanUtils', + 'Magento\\Framework\\ObjectManager\\Config\\Mapper\\Dom', + 'Magento\\Framework\\ObjectManager\\ConfigLoaderInterface', + 'Magento\\TestFramework\\ObjectManager\\Config', + 'Magento\\Framework\\ObjectManagerInterface', + 'Magento\\RemoteStorage\\Model\\Config', + 'Magento\\RemoteStorage\\Driver\\Adapter\\MetadataProviderInterfaceFactory', + 'Magento\\RemoteStorage\\Driver\\Adapter\\Cache\\CacheInterfaceFactory', + 'Magento\\RemoteStorage\\Driver\\Adapter\\CachedAdapterInterfaceFactory', + 'Magento\\Framework\\App\\Cache\\Proxy', + 'Aws\\Credentials\\CredentialsFactory', + 'Magento\\Framework\\Serialize\\Serializer\\Json', + 'Magento\\AwsS3\\Driver\\CredentialsCache', + 'Magento\\AwsS3\\Driver\\CachedCredentialsProvider', + 'Magento\\AwsS3\\Driver\\AwsS3Factory', + 'Magento\\RemoteStorage\\Driver\\DriverFactoryPool', + 'Magento\\RemoteStorage\\Driver\\DriverPool', + 'remoteReadFactory', + 'Magento\\RemoteStorage\\Model\\Filesystem\\Directory\\WriteFactory', + 'customRemoteFilesystem', + 'Magento\\Framework\\App\\ResourceConnection\\Proxy', + 'Magento\\Framework\\App\\Cache\\Frontend\\Factory', + 'Magento\\Framework\\App\\Cache\\Frontend\\Pool', + 'Magento\\Framework\\App\\Cache\\Type\\FrontendPool', + 'Magento\\Framework\\App\\Cache\\Type\\Config', + 'Magento\\Framework\\ObjectManager\\Config\\Reader\\DomFactory', + 'Magento\\Framework\\Serialize\\Serializer\\Serialize', + 'Magento\\Framework\\App\\ObjectManager\\ConfigLoader', + // Note: These were added by addSharedInstance + 'Magento\Framework\App\Filesystem\DirectoryList', + 'Magento\Framework\Filesystem\DirectoryList', + 'Magento\Framework\Filesystem', + 'Magento\Framework\Logger\LoggerProxy', + 'Magento\TestFramework\ErrorLog\Logger', + 'Magento\SalesSequence\Model\Builder', + 'Magento\Framework\App\Filesystem\DirectoryList', + 'Magento\Framework\Filesystem\DirectoryList', + 'Magento\Framework\App\DeploymentConfig', + 'Magento\Framework\ObjectManager\ConfigLoaderInterface', + 'Magento\Framework\Filesystem', + 'Magento\Framework\Logger\LoggerProxy', + 'Magento\TestFramework\ErrorLog\Logger', + 'Magento\SalesSequence\Model\Builder', 'Magento\Framework\App\Filesystem\DirectoryList', + 'Magento\Framework\Filesystem\DirectoryList', 'Magento\Framework\App\DeploymentConfig', + 'Magento\Framework\ObjectManager\ConfigLoaderInterface', + 'Magento\Framework\Filesystem', + 'Magento\Framework\Logger\LoggerProxy', + 'Magento\TestFramework\ErrorLog\Logger', + 'Magento\SalesSequence\Model\Builder', + 'Magento\GraphQl\App\State\SkipListAndFilterList', + 'Magento\GraphQl\App\State\Collector', + 'Magento\Framework\App\Filesystem\DirectoryList', 'Magento\Framework\Filesystem\DirectoryList', - 'Magento\Framework\Filesystem\DriverPool', - 'Magento\Framework\ObjectManager\RelationsInterface', - 'Magento\Framework\Interception\DefinitionInterface', - 'Magento\Framework\ObjectManager\ConfigInterface', - 'Magento\Framework\Interception\ObjectManager\ConfigInterface', - 'Magento\Framework\ObjectManager\DefinitionInterface', - 'Magento\Framework\Stdlib\BooleanUtils', - 'Magento\Framework\ObjectManager\Config\Mapper\Dom', + 'Magento\Framework\App\DeploymentConfig', 'Magento\Framework\ObjectManager\ConfigLoaderInterface', - 'Magento\TestFramework\ObjectManager\Config', - 'Magento\Framework\ObjectManagerInterface', - 'Magento\RemoteStorage\Model\Config', - 'Magento\RemoteStorage\Driver\Adapter\MetadataProviderInterfaceFactory', - 'Magento\RemoteStorage\Driver\Adapter\Cache\CacheInterfaceFactory', - 'Magento\RemoteStorage\Driver\Adapter\CachedAdapterInterfaceFactory', - 'Magento\Framework\App\Cache\Proxy', - 'Aws\Credentials\CredentialsFactory', - 'Magento\Framework\Serialize\Serializer\Json', - 'Magento\AwsS3\Driver\CredentialsCache', - 'Magento\AwsS3\Driver\CachedCredentialsProvider', - 'Magento\AwsS3\Driver\AwsS3Factory', - 'Magento\RemoteStorage\Driver\DriverFactoryPool', - 'Magento\RemoteStorage\Driver\DriverPool', - 'remoteReadFactory', - 'Magento\RemoteStorage\Model\Filesystem\Directory\WriteFactory', - 'customRemoteFilesystem', - 'Magento\Framework\App\ResourceConnection\Proxy', - 'Magento\Framework\App\Cache\Frontend\Factory', - 'Magento\Framework\App\Cache\Frontend\Pool', - 'Magento\Framework\App\Cache\Type\FrontendPool', - 'Magento\Framework\App\Cache\Type\Config', - 'Magento\Framework\ObjectManager\Config\Reader\DomFactory', - 'Magento\Framework\Serialize\Serializer\Serialize', - 'Magento\Framework\App\ObjectManager\ConfigLoader', - 'Magento\Framework\Filesystem\Directory\ReadFactory', - 'Magento\Framework\Filesystem\Directory\WriteFactory', - 'Magento\TestFramework\App\Filesystem', 'Magento\Framework\Filesystem', - 'Magento\Framework\Filesystem\Driver\File', - 'Magento\Framework\App\AreaList\Proxy', - 'Magento\Framework\Config\Scope', - 'Magento\Framework\ObjectManager\Config\Reader\Dom\Proxy', - 'Psr\Log\LoggerInterface\Proxy', - 'Magento\Framework\Interception\PluginListGenerator', - 'Magento\TestFramework\Interception\PluginList', - 'Magento\Framework\App\State', 'Magento\Framework\Logger\LoggerProxy', 'Magento\TestFramework\ErrorLog\Logger', - 'Magento\Framework\App\ResourceConnection\Config\Reader\Proxy', - 'Magento\Framework\App\Cache\Type\Config\Proxy', - 'Magento\Framework\App\ResourceConnection\Config', - 'Magento\Framework\App\ResourceConnection\ConnectionFactory', - 'Magento\Framework\Config\File\ConfigFilePool', - 'Magento\Framework\App\DeploymentConfig\Reader', - 'Magento\Framework\Stdlib\Cookie\PhpCookieReader', - 'Magento\Framework\Stdlib\StringUtils', - 'Magento\Framework\App\Route\ConfigInterface\Proxy', - 'Magento\Backend\App\Request\PathInfoProcessor\Proxy', - 'Magento\Framework\App\Request\PathInfo', - 'Magento\TestFramework\Request', - 'Magento\ResourceConnections\App\DeploymentConfig', - 'Magento\Framework\App\ResourceConnection', - 'Magento\Framework\Model\ResourceModel\Db\TransactionManager', - 'Magento\Framework\Model\ResourceModel\Db\ObjectRelationProcessor', - 'Magento\Framework\Model\ResourceModel\Db\Context', - 'Magento\SalesSequence\Model\MetaFactory', - 'Magento\SalesSequence\Model\ProfileFactory', - 'Magento\SalesSequence\Model\ResourceModel\Profile', - 'Magento\SalesSequence\Model\ResourceModel\Meta', - 'Magento\Framework\DB\Ddl\Sequence', - 'Magento\TestFramework\Db\Sequence\Builder', 'Magento\SalesSequence\Model\Builder', - 'Magento\Framework\Event\Config\Reader\Proxy', - 'Magento\Framework\Event\Config\Data', - 'Magento\Framework\App\Request\Http\Proxy', - 'Magento\Framework\Cache\InvalidateLogger', - 'Magento\Framework\App\DeploymentConfig\Writer', - 'Magento\Framework\App\Cache\State', - 'Magento\Framework\App\Area\FrontNameResolverFactory', -// 'Magento\Framework\App\AreaList', - 'Magento\Staging\Model\Event\Manager\Proxy', - 'Magento\Theme\Model\View\Design\Proxy', - 'Magento\Framework\App\Cache\Type\Translate', - 'Magento\Framework\View\Design\Fallback\Rule\SimpleFactory', - 'Magento\Framework\View\Design\Fallback\Rule\ThemeFactory', - 'Magento\Framework\View\Design\Fallback\Rule\ModuleFactory', - 'Magento\Framework\View\Design\Fallback\Rule\ModularSwitchFactory', - 'Magento\Framework\View\Design\Fallback\RulePool', - 'Magento\Framework\View\Design\FileResolution\Fallback\Resolver\Simple', - 'Magento\Framework\View\Design\FileResolution\Fallback\File', - 'Magento\Framework\View\Template\Html\Minifier', - 'Magento\TestFramework\App\State', - 'Magento\Framework\App\ScopeResolver', - 'Magento\Store\Model\StoreManagerInterface\Proxy', - 'Magento\Store\Model\Resolver\Store', - 'Magento\Store\Model\Resolver\Group', - 'Magento\Store\Model\Resolver\Website', - 'Magento\Framework\App\ScopeResolverPool', - 'Magento\Framework\App\Config\ScopeCodeResolver', - 'scopesConfigSourceAggregatedProxy', - 'Magento\Store\App\Config\Type\Scopes', - 'systemConfigSourceAggregatedProxy', - 'systemConfigPostProcessorCompositeProxy', - 'Magento\Store\Model\ResourceModel\Store', - 'Magento\Store\Model\ResourceModel\Website', - 'Magento\Store\Model\Config\Processor\Fallback', - 'Magento\Theme\Model\Config\Processor\DesignTheme\Proxy', - 'Magento\Config\Model\Placeholder\PlaceholderFactory', - 'Magento\Framework\Stdlib\ArrayManager', - 'Magento\Config\Model\Config\Processor\EnvironmentPlaceholder', - 'Magento\Framework\App\Config\PreProcessorComposite', - 'Magento\Config\App\Config\Type\System\Reader\Proxy', - 'Magento\Framework\Lock\LockBackendFactory', - 'Magento\Framework\Lock\Proxy', - 'systemConfigQueryLocker', - 'Magento\Framework\Math\Random', - 'Magento\Framework\Encryption\KeyValidator', - 'Magento\Framework\Encryption\Encryptor', - 'Magento\Config\App\Config\Type\System', - 'Magento\Translation\Model\Source\InitialTranslationSource\Proxy', - 'translationConfigInitialDataProvider', - 'translationConfigSourceAggregated', - 'Magento\Translation\App\Config\Type\Translation', - 'Magento\TestFramework\App\Config', - 'Magento\Framework\View\Asset\Config', - 'Magento\Framework\View\Design\FileResolution\Fallback\TemplateFile', - 'Magento\Framework\View\Design\FileResolution\Fallback\LocaleFile', - 'viewFileFallbackResolver', - 'Magento\Framework\View\Asset\Minification', - 'viewFileMinifiedFallbackResolver', - 'Magento\Framework\View\Design\FileResolution\Fallback\StaticFile', - 'Magento\Framework\View\Design\FileResolution\Fallback\EmailTemplateFile', - 'Magento\Framework\App\Route\Config\Reader\Proxy', - 'Magento\Framework\App\Route\Config', - 'Magento\Framework\Url\SecurityInfo\Proxy', - 'Magento\Framework\Url\ScopeResolver', - 'Magento\Framework\Session\Generic\Proxy', - 'Magento\Framework\Session\SidResolver\Proxy', - 'Magento\Framework\Url\RouteParamsResolverFactory', - 'Magento\Framework\Url\QueryParamsResolver', - 'Magento\Staging\Model\VersionManager\Proxy', - 'Magento\Staging\Model\Preview\RequestSigner\Proxy', - 'Magento\Staging\Model\Preview\RouteParamsPreprocessor', - 'Magento\Framework\Url\RouteParamsPreprocessorComposite', - 'Magento\Framework\Url\HostChecker', - 'Magento\Framework\Url', - 'Magento\Framework\Data\Collection\EntityFactory', - 'Magento\Framework\Config\ThemeFactory', - 'Magento\Framework\Component\ComponentRegistrar', - 'Magento\Framework\View\Design\Theme\ThemePackageFactory', - 'Magento\Framework\View\Design\Theme\ThemePackageList', - 'Magento\Theme\Model\Theme\Collection', - 'Magento\Framework\View\Asset\PreProcessor\Helper\Sort', - 'AssetPreProcessorPool', - 'Magento\Framework\View\Asset\PreProcessor\ChainFactory', - 'Magento\Framework\View\Asset\Source', - 'Magento\Framework\View\Asset\FileFactory', - 'Magento\Framework\View\Asset\File\FallbackContextFactory', - 'Magento\Framework\View\Asset\File\ContextFactory', - 'Magento\Framework\View\Asset\RemoteFactory', - 'Magento\Framework\View\Asset\Repository', - 'Magento\Framework\View\FileSystem', - 'Magento\Framework\Module\Declaration\Converter\Dom', - 'Magento\Framework\Module\ModuleList\Loader', - 'Magento\Framework\Module\ModuleList', - 'Magento\Framework\Module\Dir', - 'Magento\Framework\Filesystem\File\ReadFactory', - 'Magento\Framework\Config\FileIteratorFactory', - 'Magento\Framework\Module\Dir\Reader', - 'Magento\Framework\Translate\ResourceInterface\Proxy', - 'Magento\Framework\Locale\Resolver\Proxy', - 'Magento\Framework\File\Csv', - 'Magento\Framework\App\Language\ConfigFactory', - 'Magento\Framework\App\Language\ConfigFactory', - 'Magento\Framework\Translate', - 'Magento\Theme\Model\Design\Proxy', - 'Magento\Framework\View\DesignExceptions', - 'Magento\TestFramework\ObjectManager\Configurator', - 'Magento\Framework\Phrase\Renderer\Placeholder', - 'Magento\SalesSequence\Model\EntityPool', - 'Magento\TestFramework\Db\Sequence', - 'Magento\Framework\DB\Adapter\Pdo\MysqlFactory', - 'Magento\Framework\DB\Logger\FileFactory', - 'Magento\Framework\DB\Logger\QuietFactory', - 'Magento\Framework\DB\Logger\LoggerProxy', - 'Magento\Framework\DB\Select\RendererProxy', - 'Magento\Framework\DB\SelectFactory', - 'Magento\Framework\Stdlib\DateTime', - 'Magento\Framework\DB\Adapter\DdlCache', ]; public function __construct(TestFrameworkObjectManager $testFrameworkObjectManager) { @@ -222,7 +101,7 @@ public function __construct(TestFrameworkObjectManager $testFrameworkObjectManag * but luckily all the properties in the superclass are protected. */ $properties = get_object_vars($testFrameworkObjectManager); foreach ($properties as $key => $value) { - if ($key=== '_sharedInstances') { + if ($key === '_sharedInstances') { foreach($value as $class => $instance) { if (in_array($class, $this->bootstrappedObjects)) { $this->_sharedInstances[$class] = $instance; @@ -233,14 +112,8 @@ public function __construct(TestFrameworkObjectManager $testFrameworkObjectManag } } -// unset($this->_sharedInstances['Magento\Framework\Event\ObserverFactory']); $this->_sharedInstances['Magento\Framework\ObjectManagerInterface'] = $this; $this->_sharedInstances['Magento\Framework\App\ObjectManager'] = $this; -// unset($this->_sharedInstances['Magento\Framework\App\AreaList']); -// unset($testFrameworkObjectManager->_sharedInstances['Magento\Framework\App\AreaList']); - unset($this->_sharedInstances['Magento\Staging\Model\Event\Manager\Proxy']); - unset($this->_sharedInstances['Magento\Framework\Interception\PluginListInterface']); - unset($this->_sharedInstances['Magento\TestFramework\Interception\PluginList']); $this->_factory = new DynamicFactoryDecorator($this->_factory, $this); } From 7b74caac6e869729c229ecb12ed9232320ce7457 Mon Sep 17 00:00:00 2001 From: Aakash Kumar Date: Thu, 26 Oct 2023 11:20:57 -0500 Subject: [PATCH 20/31] ACPT-1625 --- .../App/GraphQlCustomerMutationsTest.php | 11 ++--- .../GraphQl/App/State/GraphQlStateDiff.php | 9 ++++ .../Quote/_files/add_simple_product.php | 6 --- .../_files/customer/create_empty_carts.php | 40 ------------------ .../GraphQl/_files/state-skip-list.php | 42 +------------------ 5 files changed, 15 insertions(+), 93 deletions(-) delete mode 100644 dev/tests/integration/testsuite/Magento/GraphQl/Quote/_files/customer/create_empty_carts.php diff --git a/dev/tests/integration/testsuite/Magento/GraphQl/App/GraphQlCustomerMutationsTest.php b/dev/tests/integration/testsuite/Magento/GraphQl/App/GraphQlCustomerMutationsTest.php index 1218afed4d3b3..748391aee8dd8 100644 --- a/dev/tests/integration/testsuite/Magento/GraphQl/App/GraphQlCustomerMutationsTest.php +++ b/dev/tests/integration/testsuite/Magento/GraphQl/App/GraphQlCustomerMutationsTest.php @@ -90,9 +90,9 @@ private function clearCustomerBeforeTest(array $emails): void /** * * @magentoDataFixture Magento/Checkout/_files/quote_with_virtual_product_saved.php - * @magentoDataFixture Magento/Checkout/_files/customers.php + * @magentoDataFixture Magento/Customer/_files/customer.php * @magentoDataFixture Magento/GraphQl/Catalog/_files/simple_product.php - * @magentoDataFixture Magento/GraphQl/Quote/_files/customer/create_empty_carts.php + * @magentoDataFixture Magento/GraphQl/Quote/_files/customer/create_empty_cart.php * @magentoDataFixture Magento/GraphQl/Quote/_files/add_simple_product.php */ public function testMergeCarts(): void @@ -104,12 +104,9 @@ public function testMergeCarts(): void $this->graphQlStateDiff->testState( $query, ['cartId1' => $cartId1, 'cartId2' => $cartId2], - ['cartId1' => $cartId1, 'cartId2' => $cartId3], - [ - ['email' => 'customer1@example.com', 'password' => 'password'], - ['email' => 'customer2@example.com', 'password' => 'password'], + [], + ['email' => 'customer@example.com', 'password' => 'password'], - ], 'mergeCarts', '"data":{"mergeCarts":', $this diff --git a/dev/tests/integration/testsuite/Magento/GraphQl/App/State/GraphQlStateDiff.php b/dev/tests/integration/testsuite/Magento/GraphQl/App/State/GraphQlStateDiff.php index 140bcae981842..1fbfaa0cbe976 100644 --- a/dev/tests/integration/testsuite/Magento/GraphQl/App/State/GraphQlStateDiff.php +++ b/dev/tests/integration/testsuite/Magento/GraphQl/App/State/GraphQlStateDiff.php @@ -91,6 +91,8 @@ public function testState( foreach($variables as $cartId) { $this->reactivateCart($cartId); } + } elseif ($operationName==='applyCouponToCart') { + $this->removeCouponFromCart($variables); } elseif ($operationName==='resetPassword') { $variables2['resetPasswordToken'] = $this->getResetPasswordToken($variables['email']); $variables2['email'] = $variables['email']; @@ -173,6 +175,13 @@ private function doRequest(string $query, array $authInfo) return $actualResponse->getContent(); } + private function removeCouponFromCart(array $variables) + { + $couponManagement = $this->objectManagerForTest->get(\Magento\Quote\Api\CouponManagementInterface::class); + $cartId = $this->getCartId($variables['cartId']); + $couponManagement->remove($cartId); + } + /** * @param array $variables * @return void diff --git a/dev/tests/integration/testsuite/Magento/GraphQl/Quote/_files/add_simple_product.php b/dev/tests/integration/testsuite/Magento/GraphQl/Quote/_files/add_simple_product.php index 7a83cd5395698..f62b463d94003 100644 --- a/dev/tests/integration/testsuite/Magento/GraphQl/Quote/_files/add_simple_product.php +++ b/dev/tests/integration/testsuite/Magento/GraphQl/Quote/_files/add_simple_product.php @@ -26,9 +26,3 @@ $quoteResource->load($quote, 'test_quote', 'reserved_order_id'); $quote->addProduct($product, 2); $cartRepository->save($quote); - - -$quote = $quoteFactory->create(); -$quoteResource->load($quote, 'test_quote2', 'reserved_order_id'); -$quote->addProduct($product, 2); -$cartRepository->save($quote); diff --git a/dev/tests/integration/testsuite/Magento/GraphQl/Quote/_files/customer/create_empty_carts.php b/dev/tests/integration/testsuite/Magento/GraphQl/Quote/_files/customer/create_empty_carts.php deleted file mode 100644 index 95bab71ca70b0..0000000000000 --- a/dev/tests/integration/testsuite/Magento/GraphQl/Quote/_files/customer/create_empty_carts.php +++ /dev/null @@ -1,40 +0,0 @@ -get(CartManagementInterface::class); -/** @var CartRepositoryInterface $cartRepository */ -$cartRepository = Bootstrap::getObjectManager()->get(CartRepositoryInterface::class); -/** @var QuoteIdMaskFactory $quoteIdMaskFactory */ -$quoteIdMaskFactory = Bootstrap::getObjectManager()->get(QuoteIdMaskFactory::class); - -$cartId = $cartManagement->createEmptyCartForCustomer(1); -$cart = $cartRepository->get($cartId); -$cart->setReservedOrderId('test_quote'); -$cartRepository->save($cart); - -/** @var QuoteIdMask $quoteIdMask */ -$quoteIdMask = $quoteIdMaskFactory->create(); -$quoteIdMask->setQuoteId($cartId) - ->save(); - -$cartId = $cartManagement->createEmptyCartForCustomer(2); -$cart = $cartRepository->get($cartId); -$cart->setReservedOrderId('test_quote2'); -$cart->setIsActive(true); -$cartRepository->save($cart); - -/** @var QuoteIdMask $quoteIdMask */ -$quoteIdMask = $quoteIdMaskFactory->create(); -$quoteIdMask->setQuoteId($cartId) - ->save(); diff --git a/dev/tests/integration/testsuite/Magento/GraphQl/_files/state-skip-list.php b/dev/tests/integration/testsuite/Magento/GraphQl/_files/state-skip-list.php index 82a43cf753610..1ec4abc4e0f9e 100644 --- a/dev/tests/integration/testsuite/Magento/GraphQl/_files/state-skip-list.php +++ b/dev/tests/integration/testsuite/Magento/GraphQl/_files/state-skip-list.php @@ -7,49 +7,20 @@ /* These classes are skipped completely during comparison. */ return [ - 'navigationMenu' => [ + '*' => [ Magento\CatalogGraphQl\Model\Resolver\Products\DataProvider\ExtractDataFromCategoryTree::class => null, - Magento\Framework\GraphQl\Query\Fields::class => null, - ], - 'productDetailByName' => [ - Magento\Framework\GraphQl\Query\Fields::class => null, Magento\Store\Model\GroupRepository::class => null, - ], - 'category' => [ - Magento\CatalogGraphQl\Model\Resolver\Products\DataProvider\ExtractDataFromCategoryTree::class => null, Magento\Framework\GraphQl\Query\Fields::class => null, - ], - 'productDetail' => [ - Magento\Framework\GraphQl\Query\Fields::class => null, - ], - 'products' => [ - Magento\Catalog\Model\Category\Attribute\Source\Sortby::class => null, - ], - 'resolveUrl' => [ - Magento\Framework\GraphQl\Query\Fields::class => null, - ], - 'applyCouponToCart' => [ Magento\SalesRule\Model\DeltaPriceRound::class => null, Magento\SalesRule\Helper\CartFixedDiscount::class => null, Magento\Quote\Model\ResourceModel\Collection\Interceptor::class => null, Magento\Quote\Model\ResourceModel\Quote\Collection\Interceptor::class => null, - ], - 'addBundleProductsToCart' => [ Magento\Quote\Api\Data\ProductOptionInterfaceFactory::class => null, Magento\Bundle\Model\CartItemProcessor::class => null, - ], - 'addConfigurableProductsToCart' => [ Magento\Eav\Plugin\Model\ResourceModel\Entity\Attribute::class => null, Magento\ConfigurableProduct\Model\Quote\Item\CartItemProcessor::class => null, - ], - 'addDownloadableProductsToCart' => [ - Magento\Downloadable\Model\Quote\Item\CartItemProcessor::class => null, - ], - 'setShippingMethodsOnCart' => [ Magento\Payment\Gateway\Config\ConfigFactory::class => null, Magento\Payment\Gateway\Data\Quote\AddressAdapterFactory::class => null, - ], - 'placeOrder' => [ Magento\Framework\Lock\Proxy::class => null, Magento\Catalog\Model\ResourceModel\Category::class => null, Magento\CatalogGraphQl\Model\Resolver\Products\SearchCriteria\CollectionProcessor\FilterProcessor\CategoryFilter::class => null, @@ -57,7 +28,6 @@ Magento\Sales\Model\ResourceModel\Order\Relation::class => null, Magento\Sales\Model\OrderIncrementIdChecker::class => null, Magento\Tax\Model\Quote\ToOrderConverter::class => null, - Magento\Sales\Model\ResourceModel\Attribute::class => null, Magento\Sales\Model\ResourceModel\Order\Handler\Address::class => null, Magento\Indexer\Model\Indexer\DeferredCacheContext::class => null, Magento\Indexer\Model\Indexer\DeferredCacheCleaner::class => null, @@ -92,17 +62,12 @@ Magento\SalesRule\Api\Data\RuleSearchResultInterfaceFactory::class => null, Magento\SalesRule\Model\RuleRepository::class => null, Magento\Reward\Model\SalesRule\RewardPointCounter::class => null, - ], - 'createCustomer' => [ Magento\TestFramework\Mail\Template\TransportBuilderMock::class => null, Magento\LoginAsCustomerAssistance\Model\IsAssistanceEnabled::class => null, Magento\Customer\Model\Indexer\AttributeProvider::class => null, - ], - 'updateCustomer' => [ Magento\LoginAsCustomerAssistance\Model\SetAssistance::class => null, Magento\LoginAsCustomerAssistance\Plugin\CustomerPlugin::class => null, - ], - '*' => [ + Magento\Quote\Model\Quote\Item\Interceptor::class => null, Magento\Framework\Stdlib\ArrayManager::class => null, Magento\Config\Model\Config\Processor\EnvironmentPlaceholder::class => null, @@ -232,7 +197,6 @@ Magento\Framework\Module\ModuleList::class => null, Magento\Framework\Module\Manager::class => null, Magento\Checkout\Model\Session::class => null, - Magento\CustomerGraphQl\Model\Context\AddUserInfoToContext::class => null, Magento\Framework\Registry::class => null, Magento\Customer\Model\AddressRegistry::class => null, Magento\Customer\Model\AttributeMetadataDataProvider::class => null, @@ -303,7 +267,6 @@ Magento\TestFramework\Response::class => null, Magento\Store\Model\WebsiteRepository::class => null, Magento\Framework\Locale\Resolver::class => null, - Magento\Store\Model\GroupRepository::class => null, Magento\Store\Model\StoreRepository::class => null, Magento\Framework\View\Design\Fallback\RulePool::class => null, Magento\Framework\View\Asset\Repository::class => null, @@ -319,7 +282,6 @@ Magento\Catalog\Model\ResourceModel\Product\Attribute\Collection::class => null, Magento\Framework\Url::class => null, Magento\Framework\HTTP\PhpEnvironment\RemoteAddress::class => null, - Magento\Framework\Module\Manager::class => null, /* AddUserInfoToContext has userContext changed by Magento\GraphQl\Model\Query\ContextFactory, * but we need to make this more robust in secure in case of unforeseen bugs. * resetState for userContext makes sense, but we need to make sure that it cannot copy current userContext. */ From e20c9b0cb9d23697ef830561effa1284d29f0aef Mon Sep 17 00:00:00 2001 From: Aakash Kumar Date: Thu, 26 Oct 2023 13:30:25 -0500 Subject: [PATCH 21/31] ACPT-1625 --- .../GraphQl/App/GraphQlCheckoutMutationsStateTest.php | 3 +++ .../GraphQl/App/GraphQlCustomerMutationsTest.php | 4 +++- .../Magento/GraphQl/_files/state-skip-list.php | 11 +++++++++-- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/dev/tests/integration/testsuite/Magento/GraphQl/App/GraphQlCheckoutMutationsStateTest.php b/dev/tests/integration/testsuite/Magento/GraphQl/App/GraphQlCheckoutMutationsStateTest.php index 7da4762283ac3..fba56b50a69a9 100644 --- a/dev/tests/integration/testsuite/Magento/GraphQl/App/GraphQlCheckoutMutationsStateTest.php +++ b/dev/tests/integration/testsuite/Magento/GraphQl/App/GraphQlCheckoutMutationsStateTest.php @@ -20,6 +20,9 @@ */ class GraphQlCheckoutMutationsStateTest extends \PHPUnit\Framework\TestCase { + /** + * @var GraphQlStateDiff + */ private $graphQlStateDiff; /** diff --git a/dev/tests/integration/testsuite/Magento/GraphQl/App/GraphQlCustomerMutationsTest.php b/dev/tests/integration/testsuite/Magento/GraphQl/App/GraphQlCustomerMutationsTest.php index 748391aee8dd8..e4fe584c6b527 100644 --- a/dev/tests/integration/testsuite/Magento/GraphQl/App/GraphQlCustomerMutationsTest.php +++ b/dev/tests/integration/testsuite/Magento/GraphQl/App/GraphQlCustomerMutationsTest.php @@ -23,6 +23,9 @@ */ class GraphQlCustomerMutationsTest extends \PHPUnit\Framework\TestCase { + /** + * @var GraphQlStateDiff + */ private $graphQlStateDiff; /** @@ -99,7 +102,6 @@ public function testMergeCarts(): void { $cartId1 = $this->graphQlStateDiff->getCartIdHash('test_order_with_virtual_product_without_address'); $cartId2 = $this->graphQlStateDiff->getCartIdHash('test_quote'); - $cartId3 = $this->graphQlStateDiff->getCartIdHash('test_quote2'); $query = $this->getCartMergeMutation(); $this->graphQlStateDiff->testState( $query, diff --git a/dev/tests/integration/testsuite/Magento/GraphQl/_files/state-skip-list.php b/dev/tests/integration/testsuite/Magento/GraphQl/_files/state-skip-list.php index 1ec4abc4e0f9e..da52af857f1b6 100644 --- a/dev/tests/integration/testsuite/Magento/GraphQl/_files/state-skip-list.php +++ b/dev/tests/integration/testsuite/Magento/GraphQl/_files/state-skip-list.php @@ -67,7 +67,6 @@ Magento\Customer\Model\Indexer\AttributeProvider::class => null, Magento\LoginAsCustomerAssistance\Model\SetAssistance::class => null, Magento\LoginAsCustomerAssistance\Plugin\CustomerPlugin::class => null, - Magento\Quote\Model\Quote\Item\Interceptor::class => null, Magento\Framework\Stdlib\ArrayManager::class => null, Magento\Config\Model\Config\Processor\EnvironmentPlaceholder::class => null, @@ -299,6 +298,10 @@ Magento\InventorySales\Model\AreProductsSalableForRequestedQty::class => null, Magento\Framework\Css\PreProcessor\Adapter\CssInliner::class => null, Magento\Customer\Model\GroupRegistry::class => null, + Magento\Framework\Config\Scope::class => null, + Magento\Framework\App\ResourceConnection\Config::class => null, + Magento\Config\App\Config\Type\System::class => null, + Magento\Framework\Cache\Config\Data::class => null, ], '*-fromConstructed' => [ Magento\Framework\Css\PreProcessor\Adapter\CssInliner::class => null, @@ -622,7 +625,11 @@ Magento\Customer\Model\Metadata\AddressCachedMetadata::class => null, Magento\Reward\Model\Reward::class => null, - Magento\Reward\Model\Reward\Rate::class => null + Magento\Reward\Model\Reward\Rate::class => null, + Magento\Framework\App\ResourceConnection\Config::class => null, + Magento\Framework\DB\Logger\LoggerProxy::class => null, + Magento\Framework\DB\Select\RendererProxy::class => null, + Magento\Framework\DB\SelectFactory::class => null, ], '' => [ ], From 33da331b77573c52abbf985b643369dc4b8aba3a Mon Sep 17 00:00:00 2001 From: Aakash Kumar Date: Thu, 26 Oct 2023 15:43:51 -0500 Subject: [PATCH 22/31] ACPT-1625 --- .../Magento/GraphQl/_files/state-skip-list.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/dev/tests/integration/testsuite/Magento/GraphQl/_files/state-skip-list.php b/dev/tests/integration/testsuite/Magento/GraphQl/_files/state-skip-list.php index da52af857f1b6..90c7f1198391d 100644 --- a/dev/tests/integration/testsuite/Magento/GraphQl/_files/state-skip-list.php +++ b/dev/tests/integration/testsuite/Magento/GraphQl/_files/state-skip-list.php @@ -476,6 +476,13 @@ Magento\CustomerCustomAttributes\Model\ResourceModel\Sales\Quote\Address::class => null, Magento\CustomerCustomAttributes\Model\ResourceModel\Sales\Quote::class => null, Magento\Indexer\Model\Indexer\DeferCacheCleaning::class => null, + Magento\ResourceConnections\App\DeploymentConfig::class => null, + Magento\Staging\Model\StagingList::class => null, + Magento\Staging\Model\ResourceModel\Update::class => null, + Magento\AdobeCommerceEventsClient\Event\EventList::class => null, + Magento\AdobeCommerceEventsClient\Event\Filter\EventFieldsFilter::class => null, + Magento\AdobeCommerceEventsClient\Event\EventStorageWriter::class => null, + Magento\TestModuleAdobeCommerceEvents\Plugin\Framework\ManagerInterfacePlugin::class => null, //Add Simple Product to Cart @@ -499,6 +506,14 @@ Magento\GiftCard\Model\Attribute\Backend\Giftcard\Amount\Interceptor::class => null, Magento\TargetRule\Model\Catalog\Product\Attribute\Backend\Rule\Interceptor::class => null, Magento\NegotiableQuote\Model\NegotiableQuote\Interceptor::class => null, + Magento\CatalogRule\Observer\RulePricesStorage::class => null, + Magento\CatalogRule\Observer\PrepareCatalogProductCollectionPricesObserver::class => null, + Magento\Quote\Api\Data\CartExtension::class => null, + Magento\Catalog\Api\Data\ProductExtension::class => null, + Magento\CatalogRule\Observer\ProcessFrontFinalPriceObserver::class => null, + Magento\Quote\Api\Data\AddressExtension::class => null, + Magento\TestModuleAdobeCommerceEvents\Plugin\Framework\ManagerInterfacePlugin::class => null, + Magento\CatalogRule\Observer\ProcessFrontFinalPriceObserver\Interceptor::class => null, //Add Virtual Product to Cart Magento\Catalog\Model\Product\Type\Virtual\Interceptor::class => null, From 0abecac31d89ceae6bf14d5e7844a57b9e4be087 Mon Sep 17 00:00:00 2001 From: Aakash Kumar Date: Thu, 26 Oct 2023 18:37:51 -0500 Subject: [PATCH 23/31] ACPT-1625 --- .../Magento/GraphQl/_files/state-skip-list.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/dev/tests/integration/testsuite/Magento/GraphQl/_files/state-skip-list.php b/dev/tests/integration/testsuite/Magento/GraphQl/_files/state-skip-list.php index 90c7f1198391d..4173df265b629 100644 --- a/dev/tests/integration/testsuite/Magento/GraphQl/_files/state-skip-list.php +++ b/dev/tests/integration/testsuite/Magento/GraphQl/_files/state-skip-list.php @@ -302,6 +302,13 @@ Magento\Framework\App\ResourceConnection\Config::class => null, Magento\Config\App\Config\Type\System::class => null, Magento\Framework\Cache\Config\Data::class => null, + Magento\CatalogRule\Observer\RulePricesStorage::class => null, + Magento\CatalogRule\Observer\PrepareCatalogProductCollectionPricesObserver::class => null, + Magento\CatalogInventory\Model\Quote\Item\QuantityValidator\QuoteItemQtyList::class => null, + Magento\CatalogInventory\Model\Quote\Item\QuantityValidator\Initializer\Option::class => null, + Magento\CatalogInventory\Model\Quote\Item\QuantityValidator\Initializer\StockItem::class => null, + Magento\CatalogRule\Observer\ProcessFrontFinalPriceObserver::class => null, + ], '*-fromConstructed' => [ Magento\Framework\Css\PreProcessor\Adapter\CssInliner::class => null, @@ -645,6 +652,14 @@ Magento\Framework\DB\Logger\LoggerProxy::class => null, Magento\Framework\DB\Select\RendererProxy::class => null, Magento\Framework\DB\SelectFactory::class => null, + + Magento\Quote\Api\Data\CartItemExtension::class => null, + Magento\CatalogInventory\Model\Quote\Item\QuantityValidator\QuoteItemQtyList::class => null, + Magento\CatalogInventory\Model\Quote\Item\QuantityValidator\Initializer\Option\Interceptor::class => null, + Magento\CatalogInventory\Model\Quote\Item\QuantityValidator\Initializer\StockItem::class => null, + Magento\SalesRule\Model\Coupon\CodeLimitManager::class => null, + Magento\SalesRule\Observer\CouponCodeValidation::class => null, + ], '' => [ ], From 07a2f89200362a76e8e566bbe33650443b7c044e Mon Sep 17 00:00:00 2001 From: Aakash Kumar Date: Thu, 26 Oct 2023 21:19:22 -0500 Subject: [PATCH 24/31] ACPT-1625 --- .../GraphQl/_files/state-skip-list.php | 43 ++++++++++++++++++- 1 file changed, 41 insertions(+), 2 deletions(-) diff --git a/dev/tests/integration/testsuite/Magento/GraphQl/_files/state-skip-list.php b/dev/tests/integration/testsuite/Magento/GraphQl/_files/state-skip-list.php index 4173df265b629..f600ef696f567 100644 --- a/dev/tests/integration/testsuite/Magento/GraphQl/_files/state-skip-list.php +++ b/dev/tests/integration/testsuite/Magento/GraphQl/_files/state-skip-list.php @@ -308,7 +308,16 @@ Magento\CatalogInventory\Model\Quote\Item\QuantityValidator\Initializer\Option::class => null, Magento\CatalogInventory\Model\Quote\Item\QuantityValidator\Initializer\StockItem::class => null, Magento\CatalogRule\Observer\ProcessFrontFinalPriceObserver::class => null, - + Magento\SalesRule\Model\Coupon\CodeLimitManager::class => null, + Magento\SalesRule\Observer\CouponCodeValidation::class => null, + Magento\Catalog\Model\Product\Type::class => null, + Magento\CatalogInventory\Helper\Stock::class => null, + Magento\Catalog\Model\Product\Link::class => null, + Magento\Downloadable\Model\Product\Type::class => null, + Magento\Bundle\Model\Product\Type::class => null, + Magento\CatalogInventory\Observer\AddInventoryDataObserver::class => null, + Magento\ConfigurableProduct\Model\Product\Type\Configurable\Attribute::class => null, + Magento\Downloadable\Model\Quote\Item\CartItemProcessor::class => null, ], '*-fromConstructed' => [ Magento\Framework\Css\PreProcessor\Adapter\CssInliner::class => null, @@ -659,7 +668,37 @@ Magento\CatalogInventory\Model\Quote\Item\QuantityValidator\Initializer\StockItem::class => null, Magento\SalesRule\Model\Coupon\CodeLimitManager::class => null, Magento\SalesRule\Observer\CouponCodeValidation::class => null, - + Magento\OfflineShipping\Model\Carrier\Flatrate::class => null, + Magento\Quote\Model\Quote\Payment::class => null, + Magento\Sales\Model\Order\Email\Container\Template::class => null, + Magento\Sales\Model\Order\Email\Container\OrderIdentity::class => null, + Magento\Customer\Model\Address\Config::class => null, + Magento\Sales\Model\Order\Address\Renderer::class => null, + Magento\Sales\Model\Order\Email\Sender\OrderCommentSender::class => null, + Magento\Sales\Model\Order\Email\Sender\InvoiceCommentSender::class => null, + Magento\Sales\Model\Order\Email\Sender\InvoiceSender::class => null, + Magento\Sales\Model\Order\Email\Sender\CreditmemoCommentSender::class => null, + Magento\Sales\Model\Order\Email\Sender\CreditmemoSender::class => null, + Magento\Sales\Model\Order\Status::class => null, + Magento\CatalogInventory\Model\Indexer\Stock\Action\Rows::class => null, + Magento\CatalogInventory\Model\ResourceModel\Indexer\Stock\DefaultStock::class => null, + Magento\ConfigurableProduct\Model\ResourceModel\Indexer\Stock\Configurable::class => null, + Magento\Bundle\Model\ResourceModel\Indexer\Stock::class => null, + Magento\GroupedProduct\Model\ResourceModel\Indexer\Stock\Grouped::class => null, + Magento\Elasticsearch\Model\Adapter\BatchDataMapper\DataMapperResolver::class => null, + Magento\Elasticsearch\Model\Adapter\Elasticsearch::class => null, + Magento\Tax\Model\TaxClass\Source\Product::class => null, + Magento\Framework\View\TemplateEnginePool::class => null, + Magento\Framework\View\Element\Template\File\Resolver::class => null, + Magento\Framework\View\Element\Template\File\Validator::class => null, + Magento\Framework\View\Element\Template\Context::class => null, + 'validator' => null, + 'inlineTranslation' => null, + Magento\Customer\Block\Address\Renderer\DefaultRenderer::class => null, + Magento\Framework\View\Layout\ReaderPool::class => null, + Magento\Framework\View\Layout\Reader\Block::class => null, + Magento\Framework\View\Layout\Reader\UiComponent::class => null, + Magento\PageCache\Observer\ProcessLayoutRenderElement::class => null, ], '' => [ ], From 8baaf0b69dc2c55e08b5958692f46813086d2580 Mon Sep 17 00:00:00 2001 From: Aakash Kumar Date: Fri, 27 Oct 2023 00:11:23 -0500 Subject: [PATCH 25/31] ACPT-1625 --- .../GraphQl/_files/state-skip-list.php | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/dev/tests/integration/testsuite/Magento/GraphQl/_files/state-skip-list.php b/dev/tests/integration/testsuite/Magento/GraphQl/_files/state-skip-list.php index f600ef696f567..63d8939224adb 100644 --- a/dev/tests/integration/testsuite/Magento/GraphQl/_files/state-skip-list.php +++ b/dev/tests/integration/testsuite/Magento/GraphQl/_files/state-skip-list.php @@ -318,8 +318,38 @@ Magento\CatalogInventory\Observer\AddInventoryDataObserver::class => null, Magento\ConfigurableProduct\Model\Product\Type\Configurable\Attribute::class => null, Magento\Downloadable\Model\Quote\Item\CartItemProcessor::class => null, + Magento\Framework\Model\ActionValidator\RemoveAction::class => null, + Magento\Staging\Model\Update\VersionHistory::class => null, + Magento\Staging\Model\UpdateRepository::class => null, + Magento\Customer\Observer\LogLastLoginAtObserver::class => null, + Magento\GraphQlCache\Model\Plugin\Auth\TokenIssuer::class => null, + Magento\GraphQlCache\Model\Plugin\Auth\TokenExtractor::class => null, + Magento\CustomerSegment\Model\ResourceModel\Segment\CollectionFactory::class => null, + Magento\Customer\Model\Visitor\Proxy::class => null, + Magento\CustomerSegment\Model\ResourceModel\Customer::class => null, + Magento\CustomerSegment\Model\Customer::class => null, + Magento\CustomerSegment\Observer\ProcessEventGenericObserver::class => null, + Magento\CustomerSegment\Model\ResourceModel\Helper::class => null, + Magento\Quote\Model\Quote\Relation::class => null, + Magento\CustomerCustomAttributes\Model\Sales\QuoteFactory::class => null, + Magento\CustomerCustomAttributes\Model\Quote\Relation::class => null, + 'QuoteRelationsComposite' => null, + Magento\SalesSequence\Model\MetaFactory::class => null, + Magento\SalesSequence\Model\ProfileFactory::class => null, + Magento\SalesSequence\Model\ResourceModel\Profile::class => null, + Magento\SalesSequence\Model\ResourceModel\Meta::class => null, + Magento\SalesSequence\Model\SequenceFactory::class => null, + Magento\SalesSequence\Model\Manager::class => null, + Magento\Quote\Model\QueryResolver::class => null, + Magento\Customer\Observer\LogLastLoginAtObserver::class => null, + Magento\GraphQlCache\Model\Plugin\Auth\TokenIssuer::class => null, + + ], '*-fromConstructed' => [ + Magento\PageBuilder\Model\Filter\Template::class => null, + Magento\PageBuilder\Plugin\Filter\TemplatePlugin::class => null, + Magento\Customer\Api\Data\CustomerExtension::class => null, Magento\Framework\Css\PreProcessor\Adapter\CssInliner::class => null, Magento\GraphQl\App\State\ObjectManager::class => null, Magento\RemoteStorage\Filesystem::class => null, From d79aebe2a09d636ba1fb87fa9baa75e01a6a0392 Mon Sep 17 00:00:00 2001 From: Aakash Kumar Date: Fri, 27 Oct 2023 09:30:40 -0500 Subject: [PATCH 26/31] ACPT-1625 --- .../GraphQl/_files/state-skip-list.php | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/dev/tests/integration/testsuite/Magento/GraphQl/_files/state-skip-list.php b/dev/tests/integration/testsuite/Magento/GraphQl/_files/state-skip-list.php index 63d8939224adb..6abd6e72ee71d 100644 --- a/dev/tests/integration/testsuite/Magento/GraphQl/_files/state-skip-list.php +++ b/dev/tests/integration/testsuite/Magento/GraphQl/_files/state-skip-list.php @@ -343,10 +343,24 @@ Magento\Quote\Model\QueryResolver::class => null, Magento\Customer\Observer\LogLastLoginAtObserver::class => null, Magento\GraphQlCache\Model\Plugin\Auth\TokenIssuer::class => null, - + Magento\StoreGraphQl\Plugin\LocalizeEmail::class => null, + Magento\Sales\Model\Order\Email\Container\Template::class => null, + Magento\Sales\Model\Order\Email\Container\OrderIdentity::class => null, + Magento\Customer\Model\Address\Config::class => null, + Magento\Sales\Model\Order\Email\Sender\OrderSender::class => null, + Magento\Sales\Model\Order\Email\Sender\OrderCommentSender::class => null, + Magento\Sales\Model\Order\Email\Sender\InvoiceCommentSender::class => null, + Magento\Sales\Model\Order\Email\Sender\InvoiceSender::class => null, + Magento\Sales\Model\Order\Email\Sender\CreditmemoCommentSender::class => null, + Magento\Sales\Model\Order\Email\Sender\CreditmemoSender::class => null, ], '*-fromConstructed' => [ + Magento\Sales\Model\ResourceModel\Grid::class => null, + Magento\Sales\Model\ResourceModel\GridPool::class => null, + Magento\Sales\Api\Data\OrderExtension::class => null, + Magento\Sales\Observer\GridSyncInsertObserver\Interceptor::class => null, + Magento\Staging\Model\UpdateRepositoryCache::class => null, Magento\PageBuilder\Model\Filter\Template::class => null, Magento\PageBuilder\Plugin\Filter\TemplatePlugin::class => null, Magento\Customer\Api\Data\CustomerExtension::class => null, @@ -729,6 +743,9 @@ Magento\Framework\View\Layout\Reader\Block::class => null, Magento\Framework\View\Layout\Reader\UiComponent::class => null, Magento\PageCache\Observer\ProcessLayoutRenderElement::class => null, + Magento\Staging\Model\Update::class => null, + Magento\Staging\Model\Update\Flag::class => null, + Magento\Catalog\Model\Category\Attribute\Source\Sortby::class => null, ], '' => [ ], From 12199680c50d500cd0c47bd53840368476a422b8 Mon Sep 17 00:00:00 2001 From: Aakash Kumar Date: Mon, 30 Oct 2023 09:23:37 -0500 Subject: [PATCH 27/31] ACPT-1625 --- .../GraphQl/_files/state-skip-list.php | 401 +++++++++--------- 1 file changed, 190 insertions(+), 211 deletions(-) diff --git a/dev/tests/integration/testsuite/Magento/GraphQl/_files/state-skip-list.php b/dev/tests/integration/testsuite/Magento/GraphQl/_files/state-skip-list.php index 6abd6e72ee71d..971c4965445cc 100644 --- a/dev/tests/integration/testsuite/Magento/GraphQl/_files/state-skip-list.php +++ b/dev/tests/integration/testsuite/Magento/GraphQl/_files/state-skip-list.php @@ -8,113 +8,233 @@ /* These classes are skipped completely during comparison. */ return [ '*' => [ - Magento\CatalogGraphQl\Model\Resolver\Products\DataProvider\ExtractDataFromCategoryTree::class => null, - Magento\Store\Model\GroupRepository::class => null, + Magento\Framework\Translate\Inline::class => null, + Magento\Framework\Json\Encoder::class => null, + Magento\Framework\Lock\Proxy::class => null, + Magento\Framework\Indexer\Table\Strategy::class => null, Magento\Framework\GraphQl\Query\Fields::class => null, + Magento\Framework\Stdlib\ArrayManager::class => null, + Magento\Framework\Reflection\MethodsMap::class => null, + Magento\Framework\Reflection\DataObjectProcessor::class => null, + Magento\Framework\Api\DataObjectHelper::class => null, + Magento\Framework\Url\QueryParamsResolver::class => null, + Magento\Framework\Acl\Data\Cache::class => null, + Magento\Framework\View\Asset\PreProcessor\Helper\Sort::class => null, + Magento\Framework\Filter\FilterManager::class => null, + Magento\Framework\Validator\Factory::class => null, + Magento\Framework\Translate\Inline\ConfigInterface\Proxy::class => null, + Magento\Framework\Json\Helper\Data::class => null, + Magento\Framework\Api\ExtensionAttribute\JoinProcessor::class => null, + Magento\Framework\Reflection\ExtensionAttributesProcessor\Proxy::class => null, + Magento\Framework\Api\ImageProcessor::class => null, + Magento\Framework\Model\ResourceModel\Db\VersionControl\Metadata::class => null, + Magento\Framework\Model\ResourceModel\Db\VersionControl\Snapshot::class => null, + Magento\Framework\Indexer\IndexerRegistry::class => null, + Magento\Framework\Session\SessionMaxSizeConfig::class => null, + Magento\Framework\Module\Manager::class => null, + Magento\Framework\MessageQueue\Code\Generator\Config\RemoteServiceReader\Communication::class => null, + Magento\Framework\Webapi\ServiceInputProcessor::class => null, + Magento\Framework\MessageQueue\Publisher\Config\RemoteService\Reader::class => null, + Magento\Framework\Registry::class => null, + Magento\Framework\Module\ModuleList::class => null, + Magento\Framework\Session\Storage::class => null, + Magento\Framework\Translate\Inline\Proxy::class => null, + Magento\Framework\App\View::class => null, + Magento\Framework\App\Action\Context::class => null, + Magento\Framework\Event\Config\Data::class => null, + Magento\Framework\App\AreaList::class => null, + Magento\Framework\App\DeploymentConfig::class => null, + Magento\Framework\App\Cache\Frontend\Pool::class => null, + Magento\Framework\App\Cache\Type\FrontendPool::class => null, + Magento\Framework\App\DeploymentConfig\Writer::class => null, + Magento\Framework\App\Cache\State::class => null, + Magento\Framework\View\Design\FileResolution\Fallback\TemplateFile::class => null, + Magento\Framework\Module\Dir\Reader::class => null, + Magento\Framework\Module\PackageInfo::class => null, + Magento\Framework\App\Language\Dictionary::class => null, + Magento\Framework\ObjectManager\ConfigInterface::class => null, + Magento\Framework\App\Cache\Type\Config::class => null, + Magento\Framework\Interception\PluginListGenerator::class => null, + Magento\Framework\View\FileSystem::class => null, + Magento\Framework\App\Config\FileResolver::class => null, + Magento\Framework\App\Request\Http\Proxy::class => null, + Magento\Framework\Event\Config\Reader\Proxy::class => null, + Magento\Framework\View\Asset\Source::class => null, + Magento\Framework\Translate\ResourceInterface\Proxy::class => null, + Magento\Framework\Locale\Resolver\Proxy::class => null, + Magento\Framework\Locale\Resolver::class => null, + Magento\Framework\App\Http\Context::class => null, + Magento\Framework\View\Design\Fallback\RulePool::class => null, + Magento\Framework\View\Asset\Repository::class => null, + Magento\Framework\HTTP\Header::class => null, + Magento\Framework\App\Route\Config::class => null, + Magento\Framework\App\Cache\Proxy::class => null, + Magento\Framework\Translate::class => null, + Magento\Framework\View\Asset\Minification::class => null, + Magento\Framework\Url::class => null, + Magento\Framework\HTTP\PhpEnvironment\RemoteAddress::class => null, + Magento\Framework\ObjectManager\DefinitionInterface::class => null, + Magento\Framework\App\ResourceConnection::class => null, + Magento\Framework\App\ResourceConnection\Interceptor::class => null, + Magento\Framework\Session\SaveHandler::class => null, // TODO: check this + Magento\Framework\Css\PreProcessor\Adapter\CssInliner::class => null, + Magento\Framework\Config\Scope::class => null, + Magento\Framework\App\ResourceConnection\Config::class => null, + Magento\Framework\Cache\Config\Data::class => null, + Magento\Framework\Model\ActionValidator\RemoveAction::class => null, + Magento\Framework\Session\Generic::class => null, + Magento\Framework\Validator\EmailAddress::class => null, + Magento\Sales\Model\Order\Email\Container\Template::class => null, + Magento\Sales\Model\Order\Email\Container\OrderIdentity::class => null, + Magento\Sales\Model\Order\Email\Sender\OrderSender::class => null, + Magento\Sales\Model\Order\Email\Sender\OrderCommentSender::class => null, + Magento\Sales\Model\Order\Email\Sender\InvoiceCommentSender::class => null, + Magento\Sales\Model\Order\Email\Sender\InvoiceSender::class => null, + Magento\Sales\Model\Order\Email\Sender\CreditmemoCommentSender::class => null, + Magento\Sales\Model\Order\Email\Sender\CreditmemoSender::class => null, + Magento\Sales\Model\Order\ItemRepository::class => null, + Magento\Sales\Model\ResourceModel\Order\Relation::class => null, + Magento\Sales\Model\ResourceModel\Order\Handler\Address::class => null, + Magento\Sales\Model\OrderIncrementIdChecker::class => null, + Magento\Sales\Api\Data\OrderSearchResultInterfaceFactory::class => null, + Magento\Sales\Api\Data\OrderExtensionFactory::class => null, + Magento\Sales\Model\OrderRepository::class => null, + Magento\Sales\Model\ResourceModel\Order\Payment::class => null, + Magento\Sales\Model\ResourceModel\Order::class => null, + Magento\Sales\Model\ResourceModel\Attribute::class => null, Magento\SalesRule\Model\DeltaPriceRound::class => null, Magento\SalesRule\Helper\CartFixedDiscount::class => null, + Magento\SalesRule\Api\Data\RuleInterfaceFactory::class => null, + Magento\SalesRule\Api\Data\ConditionInterfaceFactory::class => null, + Magento\SalesRule\Api\Data\RuleLabelInterfaceFactory::class => null, + Magento\SalesRule\Model\Converter\ToDataModel::class => null, + Magento\SalesRule\Model\Converter\ToModel::class => null, + Magento\SalesRule\Api\Data\RuleSearchResultInterfaceFactory::class => null, + Magento\SalesRule\Model\RuleRepository::class => null, + Magento\SalesRule\Model\RuleFactory::class => null, + Magento\SalesSequence\Model\MetaFactory::class => null, + Magento\SalesSequence\Model\ProfileFactory::class => null, + Magento\SalesSequence\Model\ResourceModel\Profile::class => null, + Magento\SalesSequence\Model\ResourceModel\Meta::class => null, + Magento\SalesSequence\Model\SequenceFactory::class => null, + Magento\SalesSequence\Model\Manager::class => null, Magento\Quote\Model\ResourceModel\Collection\Interceptor::class => null, Magento\Quote\Model\ResourceModel\Quote\Collection\Interceptor::class => null, Magento\Quote\Api\Data\ProductOptionInterfaceFactory::class => null, - Magento\Bundle\Model\CartItemProcessor::class => null, + Magento\Quote\Model\Quote\Item\Interceptor::class => null, + Magento\Quote\Model\Quote\Address\Interceptor::class => null, + Magento\Quote\Model\ResourceModel\Quote::class => null, + Magento\Quote\Model\QuoteIdToMaskedQuoteId::class => null, + Magento\Quote\Model\Quote\Address\Total\Collector::class => null, + Magento\Quote\Model\Quote\TotalsCollectorList::class => null, + Magento\Quote\Model\Quote\TotalsCollector::class => null, + Magento\Quote\Model\Quote::class => null, + Magento\Quote\Model\Quote\ProductOptionFactory::class => null, + Magento\Quote\Api\Data\ProductOptionExtensionFactory::class => null, + Magento\Catalog\Model\ResourceModel\Product\Indexer\Price\IndexTableRowSizeEstimator::class => null, + Magento\Catalog\Model\Indexer\Price\BatchSizeManagement::class => null, + Magento\Catalog\Model\ResourceModel\Product\Indexer\Price\DefaultPrice::class => null, + Magento\Catalog\Model\ResourceModel\Product\Indexer\Price\CompositeProductRelationsCalculator::class => null, + Magento\Catalog\Model\ResourceModel\Product\Indexer\Price\CompositeProductRowSizeEstimator::class => null, + Magento\Catalog\Model\Indexer\Price\CompositeProductBatchSizeManagement::class => null, + Magento\Catalog\Model\Indexer\Product\Price\TableMaintainer::class => null, + Magento\Catalog\Model\ResourceModel\Product\Indexer\Price\IndexTableStructureFactory::class => null, + Magento\Catalog\Model\ResourceModel\Product\Attribute\Backend\Tierprice::class => null, + Magento\Catalog\Model\ResourceModel\Product\Indexer\Price\TierPrice::class => null, + Magento\Catalog\Model\ResourceModel\Product\Indexer\Price\CompositeProductBatchSizeAdjuster::class => null, + Magento\Catalog\Model\ResourceModel\Product\Indexer\Price\BatchSizeCalculator::class => null, + Magento\Catalog\Model\ResourceModel\Product\Attribute\Collection::class => null, + Magento\Catalog\Model\Product\Attribute\Repository::class => null, + Magento\Catalog\Model\ResourceModel\Product::class => null, + Magento\Catalog\Model\ProductRepository::class => null, + Magento\Catalog\Model\Product\Type::class => null, + Magento\Catalog\Model\Product\Link::class => null, + Magento\Customer\Model\Indexer\AttributeProvider::class => null, + Magento\Customer\Model\ResourceModel\Customer::class => null, + Magento\Customer\Model\ResourceModel\CustomerRepository::class => null, + Magento\Customer\Model\Session\Validators\CutoffValidator::class => null, + Magento\Customer\Model\Customer::class => null, + Magento\Customer\Model\Session\SessionCleaner::class => null, + Magento\Customer\Model\ResourceModel\AddressRepository::class => null, + Magento\Customer\Model\CustomerRegistry::class => null, + Magento\Customer\Model\ResourceModel\Address\Relation::class => null, + Magento\Customer\Model\ResourceModel\Address::class => null, + Magento\Customer\Model\AttributeMetadataConverter::class => null, + Magento\Customer\Model\Metadata\CustomerMetadata::class => null, + Magento\Customer\Model\Metadata\AttributeMetadataCache::class => null, + Magento\Customer\Model\Metadata\CustomerCachedMetadata::class => null, + Magento\Customer\Model\Config\Share::class => null, + Magento\Customer\Model\Session\Proxy::class => null, + Magento\Customer\Model\Delegation\Storage::class => null, + Magento\Customer\Model\ResourceModel\GroupRepository::class => null, + Magento\Customer\Helper\View::class => null, + Magento\Customer\Model\Authorization\CustomerSessionUserContext::class => null, + Magento\Customer\Model\Authentication::class => null, + Magento\Customer\Model\Session::class => null, + Magento\Customer\Model\AddressRegistry::class => null, + Magento\Customer\Model\AttributeMetadataDataProvider::class => null, + Magento\Customer\Model\AccountConfirmation::class => null, + Magento\Customer\Model\AccountManagement::class => null, + Magento\Customer\Model\Plugin\CustomerFlushFormKey::class => null, + Magento\Customer\Observer\LogLastLoginAtObserver::class => null, + Magento\Customer\Model\Visitor\Proxy::class => null, + Magento\Customer\Observer\LogLastLoginAtObserver::class => null, + Magento\Customer\Api\CustomerRepositoryInterface\Proxy::class => null, + Magento\Customer\Model\ResourceModel\Attribute::class => null, + Magento\Customer\Model\Address\Config::class => null, + Magento\Indexer\Model\Indexer::class => null, + Magento\Indexer\Model\Indexer\DependencyDecorator::class => null, + Magento\Indexer\Model\Indexer\DeferredCacheContext::class => null, + Magento\Indexer\Model\Indexer\DeferredCacheCleaner::class => null, + Magento\CatalogGraphQl\Model\Resolver\Products\DataProvider\ExtractDataFromCategoryTree::class => null, + Magento\Eav\Model\ResourceModel\Entity\Attribute\Set::class => null, + Magento\Eav\Model\Entity\Attribute\Set::class => null, + Magento\Eav\Model\Entity\VersionControl\Metadata::class => null, Magento\Eav\Plugin\Model\ResourceModel\Entity\Attribute::class => null, + Magento\Store\Model\GroupRepository::class => null, + Magento\Bundle\Model\CartItemProcessor::class => null, Magento\ConfigurableProduct\Model\Quote\Item\CartItemProcessor::class => null, + Magento\ConfigurableProduct\Model\ResourceModel\Product\Indexer\Price\OptionsSelectBuilder::class => null, + Magento\ConfigurableProduct\Model\Product\Type\Configurable\Attribute::class => null, Magento\Payment\Gateway\Config\ConfigFactory::class => null, Magento\Payment\Gateway\Data\Quote\AddressAdapterFactory::class => null, - Magento\Framework\Lock\Proxy::class => null, Magento\Catalog\Model\ResourceModel\Category::class => null, Magento\CatalogGraphQl\Model\Resolver\Products\SearchCriteria\CollectionProcessor\FilterProcessor\CategoryFilter::class => null, - Magento\Sales\Model\Order\ItemRepository::class => null, - Magento\Sales\Model\ResourceModel\Order\Relation::class => null, - Magento\Sales\Model\OrderIncrementIdChecker::class => null, Magento\Tax\Model\Quote\ToOrderConverter::class => null, - Magento\Sales\Model\ResourceModel\Order\Handler\Address::class => null, - Magento\Indexer\Model\Indexer\DeferredCacheContext::class => null, - Magento\Indexer\Model\Indexer\DeferredCacheCleaner::class => null, - Magento\Catalog\Model\ResourceModel\Product\Indexer\Price\IndexTableStructureFactory::class => null, - Magento\Catalog\Model\ResourceModel\Product\Attribute\Backend\Tierprice::class => null, - Magento\Catalog\Model\ResourceModel\Product\Indexer\Price\TierPrice::class => null, - Magento\Catalog\Model\Indexer\Product\Price\TableMaintainer::class => null, Magento\Store\Model\WebsiteManagement::class => null, - Magento\Catalog\Model\ResourceModel\Product\Indexer\Price\IndexTableRowSizeEstimator::class => null, - Magento\Catalog\Model\Indexer\Price\BatchSizeManagement::class => null, - Magento\Framework\Indexer\Table\Strategy::class => null, Magento\CatalogRule\Model\ResourceModel\Rule\Product\Price::class => null, Magento\CatalogRule\Model\Indexer\ProductPriceIndexModifier::class => null, - Magento\CatalogInventory\Model\Indexer\ProductPriceIndexFilter::class => null, - Magento\Catalog\Model\ResourceModel\Product\Indexer\Price\DefaultPrice::class => null, - Magento\Catalog\Model\ResourceModel\Product\Indexer\Price\CompositeProductRelationsCalculator::class => null, - Magento\Catalog\Model\ResourceModel\Product\Indexer\Price\CompositeProductRowSizeEstimator::class => null, - Magento\Catalog\Model\Indexer\Price\CompositeProductBatchSizeManagement::class => null, - Magento\Catalog\Model\ResourceModel\Product\Indexer\Price\CompositeProductBatchSizeAdjuster::class => null, - Magento\Catalog\Model\ResourceModel\Product\Indexer\Price\BatchSizeCalculator::class => null, Magento\InventoryConfigurableProduct\Pricing\Price\Indexer\BaseStockStatusSelectProcessor::class => null, - Magento\ConfigurableProduct\Model\ResourceModel\Product\Indexer\Price\OptionsSelectBuilder::class => null, Magento\InventoryConfigurableProduct\Pricing\Price\Indexer\OptionsIndexer::class => null, Magento\InventoryCatalog\Plugin\CatalogInventory\Model\Indexer\ModifySelectInProductPriceIndexFilter::class => null, Magento\Indexer\Model\Indexer\DeferCacheCleaning::class => null, - Magento\SalesRule\Model\RuleFactory::class => null, - Magento\SalesRule\Api\Data\RuleInterfaceFactory::class => null, - Magento\SalesRule\Api\Data\ConditionInterfaceFactory::class => null, - Magento\SalesRule\Api\Data\RuleLabelInterfaceFactory::class => null, - Magento\SalesRule\Model\Converter\ToDataModel::class => null, - Magento\SalesRule\Model\Converter\ToModel::class => null, - Magento\SalesRule\Api\Data\RuleSearchResultInterfaceFactory::class => null, - Magento\SalesRule\Model\RuleRepository::class => null, Magento\Reward\Model\SalesRule\RewardPointCounter::class => null, - Magento\TestFramework\Mail\Template\TransportBuilderMock::class => null, + Magento\LoginAsCustomerAssistance\Model\IsAssistanceEnabled::class => null, - Magento\Customer\Model\Indexer\AttributeProvider::class => null, Magento\LoginAsCustomerAssistance\Model\SetAssistance::class => null, Magento\LoginAsCustomerAssistance\Plugin\CustomerPlugin::class => null, - Magento\Quote\Model\Quote\Item\Interceptor::class => null, - Magento\Framework\Stdlib\ArrayManager::class => null, Magento\Config\Model\Config\Processor\EnvironmentPlaceholder::class => null, - Magento\Quote\Model\Quote\Address\Interceptor::class => null, Magento\GraphQlNewRelic\Plugin\ReportError::class => null, - Magento\Quote\Model\ResourceModel\Quote::class => null, - Magento\Customer\Model\ResourceModel\Attribute::class => null, - Magento\Quote\Model\QuoteIdToMaskedQuoteId::class => null, - Magento\Framework\Reflection\MethodsMap::class => null, - Magento\Framework\Reflection\DataObjectProcessor::class => null, - Magento\Catalog\Model\ResourceModel\Product::class => null, - Magento\Framework\Api\DataObjectHelper::class => null, - Magento\Catalog\Model\ProductRepository::class => null, Magento\CatalogInventory\Model\StockRegistryProvider::class => null, Magento\CatalogInventory\Model\StockRegistry::class => null, - Magento\Framework\Translate\Inline::class => null, - Magento\Framework\Json\Encoder::class => null, - Magento\Customer\Model\ResourceModel\Customer::class => null, - Magento\Customer\Model\ResourceModel\CustomerRepository::class => null, - Magento\Customer\Model\Session\Validators\CutoffValidator::class => null, - Magento\Customer\Model\Customer::class => null, - Magento\Customer\Model\Session\SessionCleaner::class => null, + Magento\CatalogInventory\Model\Indexer\ProductPriceIndexFilter::class => null, Magento\Tax\Model\Calculation::class => null, Magento\Tax\Model\TaxCalculation::class => null, Magento\SalesRule\Model\RulesApplier::class => null, Magento\OfflineShipping\Model\SalesRule\Calculator::class => null, Magento\OfflineShipping\Model\Quote\Address\FreeShipping::class => null, Magento\SalesRule\Model\Validator::class => null, - Magento\Quote\Model\Quote\Address\Total\Collector::class => null, - Magento\Quote\Model\Quote\TotalsCollectorList::class => null, - Magento\Quote\Model\Quote\TotalsCollector::class => null, Magento\User\Helper\Data::class => null, Magento\Authorization\Model\RoleFactory::class => null, Magento\User\Model\UserValidationRules::class => null, - Magento\Framework\Acl\Data\Cache::class => null, Magento\User\Model\Backend\Config\ObserverConfig::class => null, Magento\User\Model\ResourceModel\User::class => null, Magento\User\Model\Notificator::class => null, Magento\TestModuleCatalogInventoryCache\Plugin\PreventCachingPreloadedStockDataInToStockRegistry::class => null, - Magento\Quote\Model\Quote\ProductOptionFactory::class => null, - Magento\Quote\Api\Data\ProductOptionExtensionFactory::class => null, Magento\Catalog\Model\CustomOptions\CustomOptionProcessor::class => null, 'orderMetadata' => null, Magento\InventorySalesAsyncOrder\Model\ReservationExecution::class => null, - Magento\Sales\Api\Data\OrderSearchResultInterfaceFactory::class => null, - Magento\Sales\Api\Data\OrderExtensionFactory::class => null, Magento\Payment\Api\Data\PaymentAdditionalInfoInterfaceFactory::class => null, - Magento\Sales\Model\OrderRepository::class => null, Magento\InventorySalesAsyncOrder\Plugin\SkipAsyncOrderCheckDataWithNoDeferredStockUpdatePlugin::class => null, Magento\InventoryInStorePickup\Model\ExtractPickupLocationAddressData::class => null, Magento\InventoryInStorePickupQuote\Model\ExtractQuoteAddressShippingAddressData::class => null, @@ -132,176 +252,82 @@ Magento\Staging\Model\Url\BaseUrlModifier::class => null, Magento\Staging\Model\Event\Manager::class => null, Magento\CatalogStaging\Plugin\Catalog\Model\Indexer\AbstractFlatState::class => null, - Magento\Framework\Url\QueryParamsResolver::class => null, Magento\Directory\Helper\Data::class => null, - Magento\Customer\Model\ResourceModel\AddressRepository::class => null, - Magento\Framework\View\Asset\PreProcessor\Helper\Sort::class => null, - Magento\Framework\Filter\FilterManager::class => null, Magento\Store\Model\Address\Renderer::class => null, - Magento\Catalog\Model\Product\Attribute\Repository::class => null, - Magento\Sales\Model\ResourceModel\Order\Payment::class => null, - Magento\Sales\Model\ResourceModel\Order::class => null, Magento\QuoteGraphQl\Plugin\ProductAttributesExtender::class => null, - Magento\Quote\Model\Quote::class => null, - Magento\Sales\Model\ResourceModel\Attribute::class => null, - Magento\Customer\Model\CustomerRegistry::class => null, - Magento\Eav\Model\ResourceModel\Entity\Attribute\Set::class => null, - Magento\Eav\Model\Entity\Attribute\Set::class => null, - Magento\Eav\Model\Entity\VersionControl\Metadata::class => null, - Magento\Customer\Model\ResourceModel\Address\Relation::class => null, - Magento\Framework\Validator\Factory::class => null, - Magento\Customer\Model\ResourceModel\Address::class => null, - Magento\Framework\Translate\Inline\ConfigInterface\Proxy::class => null, - Magento\Framework\Json\Helper\Data::class => null, - Magento\TestFramework\Api\Config\Reader\FileResolver::class => null, - Magento\Framework\Api\ExtensionAttribute\JoinProcessor::class => null, - Magento\Framework\Reflection\ExtensionAttributesProcessor\Proxy::class => null, - Magento\Customer\Model\AttributeMetadataConverter::class => null, - Magento\Customer\Model\Metadata\CustomerMetadata::class => null, - Magento\Customer\Model\Metadata\AttributeMetadataCache::class => null, - Magento\Customer\Model\Metadata\CustomerCachedMetadata::class => null, - Magento\Customer\Model\Config\Share::class => null, - Magento\Framework\Api\ImageProcessor::class => null, - Magento\Customer\Model\Session\Proxy::class => null, - Magento\Customer\Model\Delegation\Storage::class => null, - Magento\Framework\Model\ResourceModel\Db\VersionControl\Metadata::class => null, - Magento\Framework\Model\ResourceModel\Db\VersionControl\Snapshot::class => null, - Magento\Customer\Model\ResourceModel\GroupRepository::class => null, - Magento\Customer\Helper\View::class => null, - Magento\Framework\Indexer\IndexerRegistry::class => null, - Magento\Framework\Session\SessionMaxSizeConfig::class => null, + Magento\Paypal\Plugin\TransparentSessionChecker::class => null, Magento\Backend\App\Area\FrontNameResolver::class => null, Magento\Backend\Helper\Data::class => null, Magento\GraphQl\Plugin\DisableSession::class => null, - Magento\Framework\Session\Generic::class => null, - Magento\Customer\Model\Authorization\CustomerSessionUserContext::class => null, Magento\Tax\Model\TaxClass\Repository::class => null, Magento\JwtUserToken\Model\ResourceModel\FastStorageRevokedWrapper::class => null, Magento\Webapi\Model\Authorization\TokenUserContext::class => null, Magento\Authorization\Model\CompositeUserContext::class => null, Magento\Webapi\Model\WebapiRoleLocator::class => null, - Magento\Customer\Model\Authentication::class => null, 'CustomerAddressSnapshot' => null, 'EavVersionControlSnapshot' => null, - Magento\Customer\Model\Session::class => null, - Magento\Framework\Validator\EmailAddress::class => null, Magento\CustomerGraphQl\Model\Customer\ValidateCustomerData\ValidateEmail::class => null, Magento\CustomerGraphQl\Model\Customer\ValidateCustomerData::class => null, - Magento\Framework\MessageQueue\Code\Generator\Config\RemoteServiceReader\Communication::class => null, - Magento\Framework\Webapi\ServiceInputProcessor::class => null, - Magento\Framework\MessageQueue\Publisher\Config\RemoteService\Reader::class => null, Magento\Catalog\Helper\Data::class => null, + Magento\Eav\Model\AttributeDataFactory::class => null, - Magento\Framework\Module\ModuleList::class => null, - Magento\Framework\Module\Manager::class => null, Magento\Checkout\Model\Session::class => null, - Magento\Framework\Registry::class => null, - Magento\Customer\Model\AddressRegistry::class => null, - Magento\Customer\Model\AttributeMetadataDataProvider::class => null, - Magento\Customer\Model\AccountConfirmation::class => null, - Magento\Framework\Session\Storage::class => null, + Magento\JwtUserToken\Model\ConfigurableJwtSettingsProvider::class => null, Magento\JwtUserToken\Model\Reader::class => null, - Magento\Customer\Model\AccountManagement::class => null, - Magento\Customer\Model\Plugin\CustomerFlushFormKey::class => null, + Magento\Bundle\Pricing\Price\TaxPrice::class => null, Magento\Customer\Observer\AfterAddressSaveObserver::class => null, Magento\LoginAsCustomer\Model\GetLoggedAsCustomerAdminId::class => null, Magento\CustomerGraphQl\Plugin\ClearCustomerSessionAfterRequest::class => null, - Magento\Framework\Translate\Inline\Proxy::class => null, - Magento\Customer\Api\CustomerRepositoryInterface\Proxy::class => null, - Magento\Framework\App\View::class => null, - Magento\Framework\App\Action\Context::class => null, Laminas\Uri\Uri::class => null, - Magento\TestFramework\Interception\PluginList::class => null, // memory leak, wrong sql, potential issues - Magento\Framework\Event\Config\Data::class => null, - Magento\Framework\App\AreaList::class => null, - Magento\Framework\App\DeploymentConfig::class => null, Magento\Theme\Model\View\Design::class => null, - Magento\Framework\App\Cache\Frontend\Pool::class => null, - Magento\Framework\App\Cache\Type\FrontendPool::class => null, - Magento\Framework\App\DeploymentConfig\Writer::class => null, - Magento\Framework\App\Cache\State::class => null, Magento\RemoteStorage\Model\Config::class => null, Magento\Store\Model\Config\Processor\Fallback::class => null, Magento\Framework\Lock\LockBackendFactory::class => null, 'customRemoteFilesystem' => null, 'systemConfigQueryLocker' => null, - Magento\Framework\View\Design\FileResolution\Fallback\TemplateFile::class => null, Magento\Config\App\Config\Source\RuntimeConfigSource::class => null, 'scopesConfigInitialDataProvider' => null, Magento\Developer\Model\Logger\Handler\Debug::class => null, Magento\Developer\Model\Logger\Handler\Syslog::class => null, Magento\Store\App\Config\Source\RuntimeConfigSource::class => null, Magento\Store\App\Config\Type\Scopes::class => null, - Magento\Framework\Module\Dir\Reader::class => null, - Magento\Framework\Module\PackageInfo::class => null, - Magento\Framework\App\Language\Dictionary::class => null, - Magento\Framework\ObjectManager\ConfigInterface::class => null, - Magento\Framework\App\Cache\Type\Config::class => null, - Magento\Framework\Interception\PluginListGenerator::class => null, Magento\TestFramework\App\Config::class => null, Magento\TestFramework\Request::class => null, - Magento\Framework\View\FileSystem::class => null, - Magento\Framework\App\Config\FileResolver::class => null, Magento\TestFramework\ErrorLog\Logger::class => null, + Magento\TestFramework\Db\Adapter\Mysql\Interceptor::class => null, + Magento\TestFramework\Mail\Template\TransportBuilderMock::class => null, + Magento\TestFramework\Api\Config\Reader\FileResolver::class => null, 'translationConfigSourceAggregated' => null, - Magento\Framework\App\Request\Http\Proxy::class => null, - Magento\Framework\Event\Config\Reader\Proxy::class => null, Magento\Theme\Model\View\Design\Proxy::class => null, Magento\Translation\Model\Source\InitialTranslationSource\Proxy::class => null, Magento\Translation\App\Config\Type\Translation::class => null, Magento\Backend\App\Request\PathInfoProcessor\Proxy::class => null, - Magento\Framework\View\Asset\Source::class => null, - Magento\Framework\Translate\ResourceInterface\Proxy::class => null, - Magento\Framework\Locale\Resolver\Proxy::class => null, Magento\MediaStorage\Helper\File\Storage\Database::class => null, - Magento\Framework\App\Cache\Proxy::class => null, - Magento\Framework\Translate::class => null, Magento\Store\Model\StoreManager::class => null, - Magento\Framework\App\Http\Context::class => null, Magento\TestFramework\Response::class => null, Magento\Store\Model\WebsiteRepository::class => null, - Magento\Framework\Locale\Resolver::class => null, Magento\Store\Model\StoreRepository::class => null, - Magento\Framework\View\Design\Fallback\RulePool::class => null, - Magento\Framework\View\Asset\Repository::class => null, - Magento\Framework\HTTP\Header::class => null, - Magento\Framework\App\Route\Config::class => null, Magento\Store\Model\System\Store::class => null, Magento\AwsS3\Driver\CredentialsCache::class => null, Magento\Eav\Model\Config::class => null, 'AssetPreProcessorPool' => null, Magento\GraphQl\Model\Query\ContextFactory::class => null, 'viewFileMinifiedFallbackResolver' => null, - Magento\Framework\View\Asset\Minification::class => null, - Magento\Catalog\Model\ResourceModel\Product\Attribute\Collection::class => null, - Magento\Framework\Url::class => null, - Magento\Framework\HTTP\PhpEnvironment\RemoteAddress::class => null, /* AddUserInfoToContext has userContext changed by Magento\GraphQl\Model\Query\ContextFactory, * but we need to make this more robust in secure in case of unforeseen bugs. * resetState for userContext makes sense, but we need to make sure that it cannot copy current userContext. */ Magento\CustomerGraphQl\Model\Context\AddUserInfoToContext::class => null, // FIXME: see above comment - Magento\Framework\ObjectManager\DefinitionInterface::class => null, Magento\TestFramework\App\State::class => null, Magento\GraphQl\App\State\SkipListAndFilterList::class => null, // Yes, our test uses mutable state itself :-) - Magento\Framework\App\ResourceConnection::class => null, - Magento\Framework\App\ResourceConnection\Interceptor::class => null, - Magento\Framework\Session\SaveHandler::class => null, // TODO: check this - Magento\TestFramework\Db\Adapter\Mysql\Interceptor::class => null, - Magento\Indexer\Model\Indexer::class => null, - Magento\Indexer\Model\Indexer\DependencyDecorator::class => null, Magento\InventorySales\Model\IsProductSalableForRequestedQtyCondition\IsProductSalableForRequestedQtyConditionChain::class => null, Magento\InventorySales\Model\AreProductsSalableForRequestedQty::class => null, - Magento\Framework\Css\PreProcessor\Adapter\CssInliner::class => null, Magento\Customer\Model\GroupRegistry::class => null, - Magento\Framework\Config\Scope::class => null, - Magento\Framework\App\ResourceConnection\Config::class => null, Magento\Config\App\Config\Type\System::class => null, - Magento\Framework\Cache\Config\Data::class => null, Magento\CatalogRule\Observer\RulePricesStorage::class => null, Magento\CatalogRule\Observer\PrepareCatalogProductCollectionPricesObserver::class => null, Magento\CatalogInventory\Model\Quote\Item\QuantityValidator\QuoteItemQtyList::class => null, @@ -310,50 +336,27 @@ Magento\CatalogRule\Observer\ProcessFrontFinalPriceObserver::class => null, Magento\SalesRule\Model\Coupon\CodeLimitManager::class => null, Magento\SalesRule\Observer\CouponCodeValidation::class => null, - Magento\Catalog\Model\Product\Type::class => null, Magento\CatalogInventory\Helper\Stock::class => null, - Magento\Catalog\Model\Product\Link::class => null, Magento\Downloadable\Model\Product\Type::class => null, Magento\Bundle\Model\Product\Type::class => null, Magento\CatalogInventory\Observer\AddInventoryDataObserver::class => null, - Magento\ConfigurableProduct\Model\Product\Type\Configurable\Attribute::class => null, Magento\Downloadable\Model\Quote\Item\CartItemProcessor::class => null, - Magento\Framework\Model\ActionValidator\RemoveAction::class => null, Magento\Staging\Model\Update\VersionHistory::class => null, Magento\Staging\Model\UpdateRepository::class => null, - Magento\Customer\Observer\LogLastLoginAtObserver::class => null, Magento\GraphQlCache\Model\Plugin\Auth\TokenIssuer::class => null, Magento\GraphQlCache\Model\Plugin\Auth\TokenExtractor::class => null, Magento\CustomerSegment\Model\ResourceModel\Segment\CollectionFactory::class => null, - Magento\Customer\Model\Visitor\Proxy::class => null, Magento\CustomerSegment\Model\ResourceModel\Customer::class => null, Magento\CustomerSegment\Model\Customer::class => null, Magento\CustomerSegment\Observer\ProcessEventGenericObserver::class => null, Magento\CustomerSegment\Model\ResourceModel\Helper::class => null, Magento\Quote\Model\Quote\Relation::class => null, + Magento\Quote\Model\QueryResolver::class => null, Magento\CustomerCustomAttributes\Model\Sales\QuoteFactory::class => null, Magento\CustomerCustomAttributes\Model\Quote\Relation::class => null, 'QuoteRelationsComposite' => null, - Magento\SalesSequence\Model\MetaFactory::class => null, - Magento\SalesSequence\Model\ProfileFactory::class => null, - Magento\SalesSequence\Model\ResourceModel\Profile::class => null, - Magento\SalesSequence\Model\ResourceModel\Meta::class => null, - Magento\SalesSequence\Model\SequenceFactory::class => null, - Magento\SalesSequence\Model\Manager::class => null, - Magento\Quote\Model\QueryResolver::class => null, - Magento\Customer\Observer\LogLastLoginAtObserver::class => null, Magento\GraphQlCache\Model\Plugin\Auth\TokenIssuer::class => null, Magento\StoreGraphQl\Plugin\LocalizeEmail::class => null, - Magento\Sales\Model\Order\Email\Container\Template::class => null, - Magento\Sales\Model\Order\Email\Container\OrderIdentity::class => null, - Magento\Customer\Model\Address\Config::class => null, - Magento\Sales\Model\Order\Email\Sender\OrderSender::class => null, - Magento\Sales\Model\Order\Email\Sender\OrderCommentSender::class => null, - Magento\Sales\Model\Order\Email\Sender\InvoiceCommentSender::class => null, - Magento\Sales\Model\Order\Email\Sender\InvoiceSender::class => null, - Magento\Sales\Model\Order\Email\Sender\CreditmemoCommentSender::class => null, - Magento\Sales\Model\Order\Email\Sender\CreditmemoSender::class => null, - ], '*-fromConstructed' => [ Magento\Sales\Model\ResourceModel\Grid::class => null, @@ -544,8 +547,6 @@ Magento\AdobeCommerceEventsClient\Event\EventStorageWriter::class => null, Magento\TestModuleAdobeCommerceEvents\Plugin\Framework\ManagerInterfacePlugin::class => null, - - //Add Simple Product to Cart Magento\Catalog\Model\Product\Interceptor::class => null, Magento\Catalog\Model\Product\Attribute\Backend\Price\Interceptor::class => null, Magento\Catalog\Model\Product\Attribute\Backend\Tierprice\Interceptor::class => null, @@ -574,12 +575,8 @@ Magento\Quote\Api\Data\AddressExtension::class => null, Magento\TestModuleAdobeCommerceEvents\Plugin\Framework\ManagerInterfacePlugin::class => null, Magento\CatalogRule\Observer\ProcessFrontFinalPriceObserver\Interceptor::class => null, - - //Add Virtual Product to Cart Magento\Catalog\Model\Product\Type\Virtual\Interceptor::class => null, Magento\NegotiableQuote\Model\NegotiableQuote\Interceptor::class => null, - - //Add Bundle Product to Cart Magento\CatalogInventory\Model\StockRegistryProvider::class => null, Magento\CatalogInventory\Model\StockRegistry::class => null, Magento\CatalogInventory\Helper\Stock::class => null, @@ -597,14 +594,10 @@ Magento\Bundle\Model\BundleOption::class => null, Magento\Quote\Api\Data\ProductOptionExtension::class => null, Magento\Quote\Model\Quote\ProductOption::class => null, - - //Add Configurable Products to cart Magento\Catalog\Model\CategoryLink::class => null, Magento\ConfigurableProduct\Model\Product\Type\Configurable\OptionValue::class => null, Magento\ConfigurableProduct\Model\ResourceModel\Product\Type\Configurable\Attribute\Collection\Interceptor::class => null, Magento\ConfigurableProduct\Model\Quote\Item\ConfigurableItemOptionValue::class => null, - - //Add downloadable Products to cart Magento\Downloadable\Model\Product\Type\Interceptor::class => null, Magento\Downloadable\Model\LinkRepository::class => null, Magento\Downloadable\Model\SampleRepository::class => null, @@ -612,8 +605,6 @@ Magento\Downloadable\Model\ResourceModel\Sample\Collection\Interceptor::class => null, Magento\Downloadable\Model\Sample::class => null, Magento\Downloadable\Model\DownloadableOption::class => null, - - //Set shipping Address on Cart Magento\Payment\Model\MethodList::class => null, Magento\Quote\Model\PaymentMethodManagement::class => null, Magento\Quote\Model\ResourceModel\Quote\Address\Rate::class => null, @@ -621,23 +612,15 @@ Magento\Payment\Gateway\Config\ValueHandlerPool::class => null, Magento\Payment\Model\Method\Adapter::class => null, Magento\Tax\Model\Quote\GrandTotalDetailsPlugin::class => null, - - //Set Billing Address on Cart Magento\Quote\Model\BillingAddressManagement::class => null, Magento\QuoteGraphQl\Model\Cart\AssignBillingAddressToCart::class => null, - - //Set Shipping Method on Cart Magento\NegotiableQuote\Plugin\Quote\Api\JoinNegotiableQuoteTotalsPlugin::class => null, - - //Set Payment Method on Cart Magento\Captcha\Helper\Data::class => null, Magento\Checkout\Model\CaptchaRateLimiter::class => null, Magento\Captcha\Model\DefaultModel::class => null, Magento\Quote\Model\ResourceModel\Quote\Payment::class => null, Magento\CustomerGraphQl\Plugin\ClearCustomerSessionAfterRequest::class => null, Magento\Company\Plugin\Framework\Model\ActionValidator\RemoveActionPlugin::class => null, - - //Place Order Magento\Sales\Model\Order\ItemRepository\Interceptor::class => null, Magento\Sales\Model\ResourceModel\Order\Interceptor::class => null, Magento\Sales\Model\Order\Address\Validator::class => null, @@ -694,18 +677,14 @@ Magento\Paypal\Model\Api\Nvp\Interceptor::class => null, Magento\PurchaseOrder\Model\PurchaseOrder\LogManagement::class => null, Magento\Quote\Model\ResourceModel\Collection\Interceptor::class => null, - - //Update Customer Address Magento\Customer\Model\Metadata\AddressMetadata::class => null, Magento\Customer\Model\Metadata\AddressCachedMetadata::class => null, - Magento\Reward\Model\Reward::class => null, Magento\Reward\Model\Reward\Rate::class => null, Magento\Framework\App\ResourceConnection\Config::class => null, Magento\Framework\DB\Logger\LoggerProxy::class => null, Magento\Framework\DB\Select\RendererProxy::class => null, Magento\Framework\DB\SelectFactory::class => null, - Magento\Quote\Api\Data\CartItemExtension::class => null, Magento\CatalogInventory\Model\Quote\Item\QuantityValidator\QuoteItemQtyList::class => null, Magento\CatalogInventory\Model\Quote\Item\QuantityValidator\Initializer\Option\Interceptor::class => null, From 225d15e214c4bbbf3632214b393a7f7140f6b00e Mon Sep 17 00:00:00 2001 From: Aakash Kumar Date: Tue, 31 Oct 2023 14:37:00 -0500 Subject: [PATCH 28/31] ACPT-1625 --- .../testsuite/Magento/GraphQl/App/State/ObjectManager.php | 1 - 1 file changed, 1 deletion(-) diff --git a/dev/tests/integration/testsuite/Magento/GraphQl/App/State/ObjectManager.php b/dev/tests/integration/testsuite/Magento/GraphQl/App/State/ObjectManager.php index e681f81c3fcd7..2a21950e16175 100644 --- a/dev/tests/integration/testsuite/Magento/GraphQl/App/State/ObjectManager.php +++ b/dev/tests/integration/testsuite/Magento/GraphQl/App/State/ObjectManager.php @@ -7,7 +7,6 @@ namespace Magento\GraphQl\App\State; -use Magento\Framework\Event\ObserverFactory; use Magento\Framework\ObjectManager\ResetAfterRequestInterface; use Magento\TestFramework\ObjectManager as TestFrameworkObjectManager; use Weakmap; From 7750077faaa71242e4b2f6db63eea7bd230a08b3 Mon Sep 17 00:00:00 2001 From: Aakash Kumar Date: Fri, 3 Nov 2023 11:56:06 -0500 Subject: [PATCH 29/31] ACPT-1625 --- .../App/GraphQlCheckoutMutationsStateTest.php | 31 ++++---- .../App/GraphQlCustomerMutationsTest.php | 10 +-- .../Magento/GraphQl/App/GraphQlStateTest.php | 6 +- .../GraphQl/App/State/GraphQlStateDiff.php | 6 +- .../GraphQl/App/State/ObjectManager.php | 72 +++++++++---------- 5 files changed, 63 insertions(+), 62 deletions(-) diff --git a/dev/tests/integration/testsuite/Magento/GraphQl/App/GraphQlCheckoutMutationsStateTest.php b/dev/tests/integration/testsuite/Magento/GraphQl/App/GraphQlCheckoutMutationsStateTest.php index fba56b50a69a9..eb82e1c9cdc7b 100644 --- a/dev/tests/integration/testsuite/Magento/GraphQl/App/GraphQlCheckoutMutationsStateTest.php +++ b/dev/tests/integration/testsuite/Magento/GraphQl/App/GraphQlCheckoutMutationsStateTest.php @@ -8,6 +8,7 @@ namespace Magento\GraphQl\App; use Magento\Catalog\Api\ProductRepositoryInterface; +use Magento\Framework\Data\Graph; use Magento\GraphQl\App\State\GraphQlStateDiff; /** @@ -23,7 +24,7 @@ class GraphQlCheckoutMutationsStateTest extends \PHPUnit\Framework\TestCase /** * @var GraphQlStateDiff */ - private $graphQlStateDiff; + private ?GraphQlStateDiff $graphQlStateDiff = null; /** * @inheritDoc @@ -40,13 +41,13 @@ protected function setUp(): void protected function tearDown(): void { $this->graphQlStateDiff->tearDown(); + $this->graphQlStateDiff = null; parent::tearDown(); } /** * @return void - * @throws \Exception */ public function testCreateEmptyCart() : void { @@ -66,7 +67,6 @@ public function testCreateEmptyCart() : void * @magentoDataFixture Magento/GraphQl/Quote/_files/guest/create_empty_cart.php * @magentoDataFixture Magento/GraphQl/Catalog/_files/simple_product.php * @return void - * @throws \Exception */ public function testAddSimpleProductToCart() { @@ -90,7 +90,6 @@ public function testAddSimpleProductToCart() * @magentoDataFixture Magento/SalesRule/_files/coupon_code_with_wildcard.php * @magentoDataFixture Magento/SalesRule/_files/coupon_cart_fixed_discount.php * @return void - * @throws \Exception */ public function testAddCouponToCart() { @@ -112,7 +111,6 @@ public function testAddCouponToCart() * @magentoDataFixture Magento/GraphQl/Quote/_files/guest/create_empty_cart.php * @magentoDataFixture Magento/GraphQl/Catalog/_files/virtual_product.php * @return void - * @throws \Exception */ public function testAddVirtualProductToCart() { @@ -580,10 +578,7 @@ private function getAddBundleProductToCartQuery(string $cartId, string $sku) /** - * @param string $cartId - * @param float $qty - * @param string $sku - * @return void + * @return string */ private function getAddProductToCartQuery(): string { @@ -616,9 +611,6 @@ private function getAddProductToCartQuery(): string } /** - * @param string $maskedQuoteId - * @param string $sku - * @param float $quantity * @return string */ private function getAddVirtualProductToCartQuery(): string @@ -653,10 +645,7 @@ private function getAddVirtualProductToCartQuery(): string } /** - * Queries, variables, operation names, and expected responses for test - * * @return string - * @SuppressWarnings(PHPMD.ExcessiveMethodLength) */ private function getEmptyCart(): string { @@ -667,6 +656,9 @@ private function getEmptyCart(): string QUERY; } + /** + * @return string + */ private function getShippingMethodsQuery() { return <<<'QUERY' @@ -699,6 +691,9 @@ private function getShippingMethodsQuery() } + /** + * @return string + */ private function getPaymentMethodQuery() { return <<<'QUERY' @@ -723,6 +718,9 @@ private function getPaymentMethodQuery() QUERY; } + /** + * @return string + */ private function getPlaceOrderQuery(): string { return <<<'QUERY' @@ -740,6 +738,9 @@ private function getPlaceOrderQuery(): string QUERY; } + /** + * @return string + */ private function getAddCouponToCartQuery(): string { return <<<'QUERY' diff --git a/dev/tests/integration/testsuite/Magento/GraphQl/App/GraphQlCustomerMutationsTest.php b/dev/tests/integration/testsuite/Magento/GraphQl/App/GraphQlCustomerMutationsTest.php index e4fe584c6b527..6f8cd4d56ecf2 100644 --- a/dev/tests/integration/testsuite/Magento/GraphQl/App/GraphQlCustomerMutationsTest.php +++ b/dev/tests/integration/testsuite/Magento/GraphQl/App/GraphQlCustomerMutationsTest.php @@ -24,9 +24,9 @@ class GraphQlCustomerMutationsTest extends \PHPUnit\Framework\TestCase { /** - * @var GraphQlStateDiff + * @var GraphQlStateDiff|null */ - private $graphQlStateDiff; + private ?GraphQlStateDiff $graphQlStateDiff = null; /** * @inheritDoc @@ -43,6 +43,7 @@ protected function setUp(): void protected function tearDown(): void { $this->graphQlStateDiff->tearDown(); + $this->graphQlStateDiff = null; parent::tearDown(); } @@ -51,7 +52,6 @@ protected function tearDown(): void * @magentoDataFixture Magento/Customer/_files/customer_address.php * @dataProvider customerDataProvider * @return void - * @throws \Exception */ public function testCustomerState( string $query, @@ -136,8 +136,6 @@ public function testRequestPasswordResetEmail(): void /** * @magentoDataFixture Magento/Customer/_files/customer.php * @return void - * @throws LocalizedException - * @throws NoSuchEntityException */ public function testResetPassword(): void { @@ -158,8 +156,6 @@ public function testResetPassword(): void /** * @magentoDataFixture Magento/Customer/_files/customer.php * @return void - * @throws LocalizedException - * @throws NoSuchEntityException */ public function testChangePassword(): void { diff --git a/dev/tests/integration/testsuite/Magento/GraphQl/App/GraphQlStateTest.php b/dev/tests/integration/testsuite/Magento/GraphQl/App/GraphQlStateTest.php index affe13934f3fc..1eec0ddd1f2ae 100644 --- a/dev/tests/integration/testsuite/Magento/GraphQl/App/GraphQlStateTest.php +++ b/dev/tests/integration/testsuite/Magento/GraphQl/App/GraphQlStateTest.php @@ -25,7 +25,10 @@ class GraphQlStateTest extends \PHPUnit\Framework\TestCase */ private $getMaskedQuoteIdByReservedOrderId; - private $graphQlStateDiff; + /** + * @var GraphQlStateDiff|null + */ + private ?GraphQlStateDiff $graphQlStateDiff; /** * @inheritDoc @@ -42,6 +45,7 @@ protected function setUp(): void protected function tearDown(): void { $this->graphQlStateDiff->tearDown(); + $this->graphQlStateDiff = null; parent::tearDown(); } diff --git a/dev/tests/integration/testsuite/Magento/GraphQl/App/State/GraphQlStateDiff.php b/dev/tests/integration/testsuite/Magento/GraphQl/App/State/GraphQlStateDiff.php index 1fbfaa0cbe976..5ffd74762cc2e 100644 --- a/dev/tests/integration/testsuite/Magento/GraphQl/App/State/GraphQlStateDiff.php +++ b/dev/tests/integration/testsuite/Magento/GraphQl/App/State/GraphQlStateDiff.php @@ -33,13 +33,13 @@ class GraphQlStateDiff private const CONTENT_TYPE = 'application/json'; /** @var ObjectManagerInterface */ - private ObjectManagerInterface $objectManagerBeforeTest; + private readonly ObjectManagerInterface $objectManagerBeforeTest; /** @var ObjectManager */ - private ObjectManager $objectManagerForTest; + private readonly ObjectManager $objectManagerForTest; /** @var Comparator */ - private Comparator $comparator; + private readonly Comparator $comparator; public function __construct() { diff --git a/dev/tests/integration/testsuite/Magento/GraphQl/App/State/ObjectManager.php b/dev/tests/integration/testsuite/Magento/GraphQl/App/State/ObjectManager.php index 2a21950e16175..938e843373640 100644 --- a/dev/tests/integration/testsuite/Magento/GraphQl/App/State/ObjectManager.php +++ b/dev/tests/integration/testsuite/Magento/GraphQl/App/State/ObjectManager.php @@ -23,43 +23,43 @@ class ObjectManager extends TestFrameworkObjectManager */ private $bootstrappedObjects = [ // Note: These are after $objectManager = $this->_factory->create($overriddenParams); - 'Magento\\Framework\\App\\DeploymentConfig', - 'Magento\\Framework\\App\\Filesystem\\DirectoryList', - 'Magento\\Framework\\Filesystem\\DirectoryList', - 'Magento\\Framework\\Filesystem\\DriverPool', - 'Magento\\Framework\\ObjectManager\\RelationsInterface', - 'Magento\\Framework\\Interception\\DefinitionInterface', - 'Magento\\Framework\\ObjectManager\\ConfigInterface', - 'Magento\\Framework\\Interception\\ObjectManager\\ConfigInterface', - 'Magento\\Framework\\ObjectManager\\DefinitionInterface', - 'Magento\\Framework\\Stdlib\\BooleanUtils', - 'Magento\\Framework\\ObjectManager\\Config\\Mapper\\Dom', - 'Magento\\Framework\\ObjectManager\\ConfigLoaderInterface', - 'Magento\\TestFramework\\ObjectManager\\Config', - 'Magento\\Framework\\ObjectManagerInterface', - 'Magento\\RemoteStorage\\Model\\Config', - 'Magento\\RemoteStorage\\Driver\\Adapter\\MetadataProviderInterfaceFactory', - 'Magento\\RemoteStorage\\Driver\\Adapter\\Cache\\CacheInterfaceFactory', - 'Magento\\RemoteStorage\\Driver\\Adapter\\CachedAdapterInterfaceFactory', - 'Magento\\Framework\\App\\Cache\\Proxy', - 'Aws\\Credentials\\CredentialsFactory', - 'Magento\\Framework\\Serialize\\Serializer\\Json', - 'Magento\\AwsS3\\Driver\\CredentialsCache', - 'Magento\\AwsS3\\Driver\\CachedCredentialsProvider', - 'Magento\\AwsS3\\Driver\\AwsS3Factory', - 'Magento\\RemoteStorage\\Driver\\DriverFactoryPool', - 'Magento\\RemoteStorage\\Driver\\DriverPool', + 'Magento\Framework\App\DeploymentConfig', + 'Magento\Framework\App\Filesystem\DirectoryList', + 'Magento\Framework\Filesystem\DirectoryList', + 'Magento\Framework\Filesystem\DriverPool', + 'Magento\Framework\ObjectManager\RelationsInterface', + 'Magento\Framework\Interception\DefinitionInterface', + 'Magento\Framework\ObjectManager\ConfigInterface', + 'Magento\Framework\Interception\ObjectManager\ConfigInterface', + 'Magento\Framework\ObjectManager\DefinitionInterface', + 'Magento\Framework\Stdlib\BooleanUtils', + 'Magento\Framework\ObjectManager\Config\Mapper\Dom', + 'Magento\Framework\ObjectManager\ConfigLoaderInterface', + 'Magento\TestFramework\ObjectManager\Config', + 'Magento\Framework\ObjectManagerInterface', + 'Magento\RemoteStorage\Model\Config', + 'Magento\RemoteStorage\Driver\Adapter\MetadataProviderInterfaceFactory', + 'Magento\RemoteStorage\Driver\Adapter\Cache\CacheInterfaceFactory', + 'Magento\RemoteStorage\Driver\Adapter\CachedAdapterInterfaceFactory', + 'Magento\Framework\App\Cache\Proxy', + 'Aws\Credentials\CredentialsFactory', + 'Magento\Framework\Serialize\Serializer\Json', + 'Magento\AwsS3\Driver\CredentialsCache', + 'Magento\AwsS3\Driver\CachedCredentialsProvider', + 'Magento\AwsS3\Driver\AwsS3Factory', + 'Magento\RemoteStorage\Driver\DriverFactoryPool', + 'Magento\RemoteStorage\Driver\DriverPool', 'remoteReadFactory', - 'Magento\\RemoteStorage\\Model\\Filesystem\\Directory\\WriteFactory', + 'Magento\RemoteStorage\Model\Filesystem\Directory\WriteFactory', 'customRemoteFilesystem', - 'Magento\\Framework\\App\\ResourceConnection\\Proxy', - 'Magento\\Framework\\App\\Cache\\Frontend\\Factory', - 'Magento\\Framework\\App\\Cache\\Frontend\\Pool', - 'Magento\\Framework\\App\\Cache\\Type\\FrontendPool', - 'Magento\\Framework\\App\\Cache\\Type\\Config', - 'Magento\\Framework\\ObjectManager\\Config\\Reader\\DomFactory', - 'Magento\\Framework\\Serialize\\Serializer\\Serialize', - 'Magento\\Framework\\App\\ObjectManager\\ConfigLoader', + 'Magento\Framework\App\ResourceConnection\Proxy', + 'Magento\Framework\App\Cache\Frontend\Factory', + 'Magento\Framework\App\Cache\Frontend\Pool', + 'Magento\Framework\App\Cache\Type\FrontendPool', + 'Magento\Framework\App\Cache\Type\Config', + 'Magento\Framework\ObjectManager\Config\Reader\DomFactory', + 'Magento\Framework\Serialize\Serializer\Serialize', + 'Magento\Framework\App\ObjectManager\ConfigLoader', // Note: These were added by addSharedInstance 'Magento\Framework\App\Filesystem\DirectoryList', 'Magento\Framework\Filesystem\DirectoryList', @@ -101,7 +101,7 @@ public function __construct(TestFrameworkObjectManager $testFrameworkObjectManag $properties = get_object_vars($testFrameworkObjectManager); foreach ($properties as $key => $value) { if ($key === '_sharedInstances') { - foreach($value as $class => $instance) { + foreach ($value as $class => $instance) { if (in_array($class, $this->bootstrappedObjects)) { $this->_sharedInstances[$class] = $instance; } From c74824e57a53f3301dfc812057d450c96bcd2b51 Mon Sep 17 00:00:00 2001 From: Aakash Kumar Date: Mon, 6 Nov 2023 09:52:21 -0600 Subject: [PATCH 30/31] ACPT-1625 Co-authored-by: Andrii Dimov --- .../GraphQl/App/GraphQlCheckoutMutationsStateTest.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/dev/tests/integration/testsuite/Magento/GraphQl/App/GraphQlCheckoutMutationsStateTest.php b/dev/tests/integration/testsuite/Magento/GraphQl/App/GraphQlCheckoutMutationsStateTest.php index eb82e1c9cdc7b..84acf833b3e58 100644 --- a/dev/tests/integration/testsuite/Magento/GraphQl/App/GraphQlCheckoutMutationsStateTest.php +++ b/dev/tests/integration/testsuite/Magento/GraphQl/App/GraphQlCheckoutMutationsStateTest.php @@ -8,7 +8,6 @@ namespace Magento\GraphQl\App; use Magento\Catalog\Api\ProductRepositoryInterface; -use Magento\Framework\Data\Graph; use Magento\GraphQl\App\State\GraphQlStateDiff; /** @@ -22,7 +21,7 @@ class GraphQlCheckoutMutationsStateTest extends \PHPUnit\Framework\TestCase { /** - * @var GraphQlStateDiff + * @var GraphQlStateDiff|null */ private ?GraphQlStateDiff $graphQlStateDiff = null; @@ -51,8 +50,8 @@ protected function tearDown(): void */ public function testCreateEmptyCart() : void { - $this->graphQlStateDiff-> - testState($this->getEmptyCart(), + $this->graphQlStateDiff->testState( + $this->getEmptyCart(), [], [], [], From de8fe82e47003164d779abe54f8361b8a51bc649 Mon Sep 17 00:00:00 2001 From: Aakash Kumar Date: Mon, 6 Nov 2023 12:24:15 -0600 Subject: [PATCH 31/31] ACPT-1625 Co-authored-by: Andrii Dimov --- .../GraphQl/App/GraphQlCustomerMutationsTest.php | 2 -- .../Magento/GraphQl/App/GraphQlStateTest.php | 11 +++++------ 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/dev/tests/integration/testsuite/Magento/GraphQl/App/GraphQlCustomerMutationsTest.php b/dev/tests/integration/testsuite/Magento/GraphQl/App/GraphQlCustomerMutationsTest.php index 6f8cd4d56ecf2..3dfbb01cc8de1 100644 --- a/dev/tests/integration/testsuite/Magento/GraphQl/App/GraphQlCustomerMutationsTest.php +++ b/dev/tests/integration/testsuite/Magento/GraphQl/App/GraphQlCustomerMutationsTest.php @@ -8,7 +8,6 @@ namespace Magento\GraphQl\App; use Magento\Customer\Api\CustomerRepositoryInterface; -use Magento\Framework\Exception\LocalizedException; use Magento\Framework\Exception\NoSuchEntityException; use Magento\Framework\Registry; use Magento\GraphQl\App\State\GraphQlStateDiff; @@ -108,7 +107,6 @@ public function testMergeCarts(): void ['cartId1' => $cartId1, 'cartId2' => $cartId2], [], ['email' => 'customer@example.com', 'password' => 'password'], - 'mergeCarts', '"data":{"mergeCarts":', $this diff --git a/dev/tests/integration/testsuite/Magento/GraphQl/App/GraphQlStateTest.php b/dev/tests/integration/testsuite/Magento/GraphQl/App/GraphQlStateTest.php index 1eec0ddd1f2ae..8d4702e28c215 100644 --- a/dev/tests/integration/testsuite/Magento/GraphQl/App/GraphQlStateTest.php +++ b/dev/tests/integration/testsuite/Magento/GraphQl/App/GraphQlStateTest.php @@ -72,8 +72,8 @@ public function testState( string $operationName, string $expected, ): void { - $this->graphQlStateDiff-> - testState($query, $variables, $variables2, $authInfo, $operationName, $expected, $this); + $this->graphQlStateDiff + ->testState($query, $variables, $variables2, $authInfo, $operationName, $expected, $this); } @@ -108,15 +108,14 @@ public function testCartState( array $authInfo, string $operationName, string $expected - ): void - { + ): void { if ($operationName == 'getCart') { $this->getMaskedQuoteIdByReservedOrderId = $this->graphQlStateDiff->getTestObjectManager()->get(GetMaskedQuoteIdByReservedOrderId::class); $variables['id'] = $this->getMaskedQuoteIdByReservedOrderId->execute($variables['id']); } - $this->graphQlStateDiff-> - testState($query, $variables, $variables2, $authInfo, $operationName, $expected, $this); + $this->graphQlStateDiff + ->testState($query, $variables, $variables2, $authInfo, $operationName, $expected, $this); } /**