diff --git a/app/code/Magento/Checkout/etc/webapi.xml b/app/code/Magento/Checkout/etc/webapi.xml
index 639d3b8b8e1d6..65e2518972627 100644
--- a/app/code/Magento/Checkout/etc/webapi.xml
+++ b/app/code/Magento/Checkout/etc/webapi.xml
@@ -54,7 +54,7 @@
-
+
diff --git a/dev/tests/api-functional/testsuite/Magento/Catalog/Api/AttributeSetRepositoryTest.php b/dev/tests/api-functional/testsuite/Magento/Catalog/Api/AttributeSetRepositoryTest.php
index 7b2bb1d5b2e74..d93060b8a0031 100644
--- a/dev/tests/api-functional/testsuite/Magento/Catalog/Api/AttributeSetRepositoryTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/Catalog/Api/AttributeSetRepositoryTest.php
@@ -183,8 +183,8 @@ public function testGetList()
$serviceInfo = [
'rest' => [
- 'resourcePath' => '/V1/products/attribute-sets/sets/list',
- 'httpMethod' => RestConfig::HTTP_METHOD_PUT,
+ 'resourcePath' => '/V1/products/attribute-sets/sets/list' . '?' . http_build_query($searchCriteria),
+ 'httpMethod' => RestConfig::HTTP_METHOD_GET,
],
'soap' => [
'service' => 'catalogAttributeSetRepositoryV1',
diff --git a/dev/tests/api-functional/testsuite/Magento/Catalog/Api/CategoryAttributeRepositoryTest.php b/dev/tests/api-functional/testsuite/Magento/Catalog/Api/CategoryAttributeRepositoryTest.php
index a206507971116..c06e5fa114b0f 100644
--- a/dev/tests/api-functional/testsuite/Magento/Catalog/Api/CategoryAttributeRepositoryTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/Catalog/Api/CategoryAttributeRepositoryTest.php
@@ -50,8 +50,8 @@ public function testGetList()
$serviceInfo = [
'rest' => [
- 'resourcePath' => self::RESOURCE_PATH . '/',
- 'httpMethod' => RestConfig::HTTP_METHOD_PUT,
+ 'resourcePath' => self::RESOURCE_PATH . '?' . http_build_query($searchCriteria),
+ 'httpMethod' => RestConfig::HTTP_METHOD_GET,
],
'soap' => [
'service' => self::SERVICE_NAME,
diff --git a/dev/tests/api-functional/testsuite/Magento/Catalog/Api/ProductAttributeGroupRepositoryTest.php b/dev/tests/api-functional/testsuite/Magento/Catalog/Api/ProductAttributeGroupRepositoryTest.php
index daf34f578a9bd..4d01373bd075e 100644
--- a/dev/tests/api-functional/testsuite/Magento/Catalog/Api/ProductAttributeGroupRepositoryTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/Catalog/Api/ProductAttributeGroupRepositoryTest.php
@@ -111,8 +111,8 @@ public function testGetList()
$serviceInfo = [
'rest' => [
- 'resourcePath' => self::RESOURCE_PATH . "/groups/list",
- 'httpMethod' => \Magento\Webapi\Model\Rest\Config::HTTP_METHOD_PUT,
+ 'resourcePath' => self::RESOURCE_PATH . '/groups/list' . '?' . http_build_query($searchCriteria),
+ 'httpMethod' => \Magento\Webapi\Model\Rest\Config::HTTP_METHOD_GET,
],
'soap' => [
'service' => self::SERVICE_NAME,
diff --git a/dev/tests/api-functional/testsuite/Magento/Catalog/Api/ProductAttributeRepositoryTest.php b/dev/tests/api-functional/testsuite/Magento/Catalog/Api/ProductAttributeRepositoryTest.php
index 20742ba9ee0e6..898fe866bfdc5 100644
--- a/dev/tests/api-functional/testsuite/Magento/Catalog/Api/ProductAttributeRepositoryTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/Catalog/Api/ProductAttributeRepositoryTest.php
@@ -51,8 +51,8 @@ public function testGetList()
$serviceInfo = [
'rest' => [
- 'resourcePath' => self::RESOURCE_PATH . '/',
- 'httpMethod' => RestConfig::HTTP_METHOD_PUT,
+ 'resourcePath' => self::RESOURCE_PATH . '?' . http_build_query($searchCriteria),
+ 'httpMethod' => RestConfig::HTTP_METHOD_GET,
],
'soap' => [
'service' => self::SERVICE_NAME,
diff --git a/dev/tests/api-functional/testsuite/Magento/Catalog/Api/ProductRepositoryInterfaceTest.php b/dev/tests/api-functional/testsuite/Magento/Catalog/Api/ProductRepositoryInterfaceTest.php
index 7b9e84a65f4d1..199094bbaf8c2 100644
--- a/dev/tests/api-functional/testsuite/Magento/Catalog/Api/ProductRepositoryInterfaceTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/Catalog/Api/ProductRepositoryInterfaceTest.php
@@ -182,8 +182,8 @@ public function testGetList()
$serviceInfo = [
'rest' => [
- 'resourcePath' => self::RESOURCE_PATH . '/',
- 'httpMethod' => RestConfig::HTTP_METHOD_PUT,
+ 'resourcePath' => self::RESOURCE_PATH . '?' . http_build_query($searchCriteria),
+ 'httpMethod' => RestConfig::HTTP_METHOD_GET,
],
'soap' => [
'service' => self::SERVICE_NAME,
diff --git a/dev/tests/api-functional/testsuite/Magento/Checkout/Service/V1/Cart/ReadServiceTest.php b/dev/tests/api-functional/testsuite/Magento/Checkout/Service/V1/Cart/ReadServiceTest.php
index 2d2f8063b359c..670ed6f20948f 100644
--- a/dev/tests/api-functional/testsuite/Magento/Checkout/Service/V1/Cart/ReadServiceTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/Checkout/Service/V1/Cart/ReadServiceTest.php
@@ -204,18 +204,6 @@ public function testGetCartList()
{
$cart = $this->getCart('test01');
- $serviceInfo = [
- 'rest' => [
- 'resourcePath' => '/V1/carts',
- 'httpMethod' => RestConfig::HTTP_METHOD_PUT,
- ],
- 'soap' => [
- 'service' => 'checkoutCartReadServiceV1',
- 'serviceVersion' => 'V1',
- 'operation' => 'checkoutCartReadServiceV1GetCartList',
- ],
- ];
-
// The following two filters are used as alternatives. The target cart does not match the first one.
$grandTotalFilter = $this->filterBuilder->setField('grand_total')
->setConditionType('gteq')
@@ -246,6 +234,17 @@ public function testGetCartList()
$searchCriteria = $this->searchBuilder->create()->__toArray();
$requestData = ['searchCriteria' => $searchCriteria];
+ $serviceInfo = [
+ 'rest' => [
+ 'resourcePath' => '/V1/carts' . '?' . http_build_query($requestData),
+ 'httpMethod' => RestConfig::HTTP_METHOD_GET,
+ ],
+ 'soap' => [
+ 'service' => 'checkoutCartReadServiceV1',
+ 'serviceVersion' => 'V1',
+ 'operation' => 'checkoutCartReadServiceV1GetCartList',
+ ],
+ ];
$searchResult = $this->_webApiCall($serviceInfo, $requestData);
$this->assertArrayHasKey('total_count', $searchResult);
$this->assertEquals(1, $searchResult['total_count']);
@@ -272,6 +271,14 @@ public function testGetCartList()
*/
public function testGetCartListThrowsExceptionIfProvidedSearchFieldIsInvalid()
{
+ $invalidFilter = $this->filterBuilder->setField('invalid_field')
+ ->setConditionType('eq')
+ ->setValue(0)
+ ->create();
+
+ $this->searchBuilder->addFilter([$invalidFilter]);
+ $searchCriteria = $this->searchBuilder->create()->__toArray();
+ $requestData = ['searchCriteria' => $searchCriteria];
$serviceInfo = [
'soap' => [
'service' => 'checkoutCartReadServiceV1',
@@ -279,19 +286,10 @@ public function testGetCartListThrowsExceptionIfProvidedSearchFieldIsInvalid()
'operation' => 'checkoutCartReadServiceV1GetCartList',
],
'rest' => [
- 'resourcePath' => '/V1/carts',
- 'httpMethod' => RestConfig::HTTP_METHOD_PUT,
+ 'resourcePath' => '/V1/carts' . '?' . http_build_query($requestData),
+ 'httpMethod' => RestConfig::HTTP_METHOD_GET,
],
];
-
- $invalidFilter = $this->filterBuilder->setField('invalid_field')
- ->setConditionType('eq')
- ->setValue(0)
- ->create();
-
- $this->searchBuilder->addFilter([$invalidFilter]);
- $searchCriteria = $this->searchBuilder->create()->__toArray();
- $requestData = ['searchCriteria' => $searchCriteria];
$this->_webApiCall($serviceInfo, $requestData);
}
}
diff --git a/dev/tests/api-functional/testsuite/Magento/Customer/Api/CustomerRepositoryTest.php b/dev/tests/api-functional/testsuite/Magento/Customer/Api/CustomerRepositoryTest.php
index db1b03f1f4772..9ad918cf4e35a 100644
--- a/dev/tests/api-functional/testsuite/Magento/Customer/Api/CustomerRepositoryTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/Customer/Api/CustomerRepositoryTest.php
@@ -344,10 +344,15 @@ public function testSearchCustomers()
->setValue($customerData[Customer::EMAIL])
->create();
$this->searchCriteriaBuilder->addFilter([$filter]);
+ $searchData = $this->dataObjectProcessor->buildOutputDataArray(
+ $this->searchCriteriaBuilder->create(),
+ 'Magento\Framework\Api\SearchCriteriaInterface'
+ );
+ $requestData = ['searchCriteria' => $searchData];
$serviceInfo = [
'rest' => [
- 'resourcePath' => self::RESOURCE_PATH . '/search',
- 'httpMethod' => RestConfig::HTTP_METHOD_POST,
+ 'resourcePath' => self::RESOURCE_PATH . '/search' . '?' . http_build_query($requestData),
+ 'httpMethod' => RestConfig::HTTP_METHOD_GET,
],
'soap' => [
'service' => self::SERVICE_NAME,
@@ -355,11 +360,6 @@ public function testSearchCustomers()
'operation' => self::SERVICE_NAME . 'getList',
],
];
- $searchData = $this->dataObjectProcessor->buildOutputDataArray(
- $this->searchCriteriaBuilder->create(),
- 'Magento\Framework\Api\SearchCriteriaInterface'
- );
- $requestData = ['searchCriteria' => $searchData];
$searchResults = $this->_webApiCall($serviceInfo, $requestData);
$this->assertEquals(1, $searchResults['total_count']);
$this->assertEquals($customerData[Customer::ID], $searchResults['items'][0][Customer::ID]);
@@ -449,10 +449,12 @@ public function testSearchCustomersMultipleFiltersWithSort()
$this->searchCriteriaBuilder->setSortOrders([$sortOrder]);
$searchCriteria = $this->searchCriteriaBuilder->create();
+ $searchData = $searchCriteria->__toArray();
+ $requestData = ['searchCriteria' => $searchData];
$serviceInfo = [
'rest' => [
- 'resourcePath' => self::RESOURCE_PATH . '/search',
- 'httpMethod' => RestConfig::HTTP_METHOD_POST,
+ 'resourcePath' => self::RESOURCE_PATH . '/search' . '?' . http_build_query($requestData),
+ 'httpMethod' => RestConfig::HTTP_METHOD_GET,
],
'soap' => [
'service' => self::SERVICE_NAME,
@@ -460,8 +462,6 @@ public function testSearchCustomersMultipleFiltersWithSort()
'operation' => self::SERVICE_NAME . 'getList',
],
];
- $searchData = $searchCriteria->__toArray();
- $requestData = ['searchCriteria' => $searchData];
$searchResults = $this->_webApiCall($serviceInfo, $requestData);
$this->assertEquals(2, $searchResults['total_count']);
$this->assertEquals($customerData1[Customer::ID], $searchResults['items'][0][Customer::ID]);
@@ -525,10 +525,12 @@ public function testSearchCustomersNonExistentMultipleFilters()
$this->searchCriteriaBuilder->addFilter([$filter1, $filter2]);
$this->searchCriteriaBuilder->addFilter([$filter3]);
$searchCriteria = $this->searchCriteriaBuilder->create();
+ $searchData = $searchCriteria->__toArray();
+ $requestData = ['searchCriteria' => $searchData];
$serviceInfo = [
'rest' => [
- 'resourcePath' => self::RESOURCE_PATH . '/search',
- 'httpMethod' => RestConfig::HTTP_METHOD_POST,
+ 'resourcePath' => self::RESOURCE_PATH . '/search' . '?' . http_build_query($requestData),
+ 'httpMethod' => RestConfig::HTTP_METHOD_GET,
],
'soap' => [
'service' => self::SERVICE_NAME,
@@ -536,8 +538,6 @@ public function testSearchCustomersNonExistentMultipleFilters()
'operation' => self::SERVICE_NAME . 'getList',
],
];
- $searchData = $searchCriteria->__toArray();
- $requestData = ['searchCriteria' => $searchData];
$searchResults = $this->_webApiCall($serviceInfo, $requestData);
$this->assertEquals(0, $searchResults['total_count'], 'No results expected for non-existent email.');
}
@@ -602,10 +602,12 @@ public function testSearchCustomersMultipleFilterGroups()
$this->searchCriteriaBuilder->addFilter([$filter2, $filter3]);
$this->searchCriteriaBuilder->addFilter([$filter4]);
$searchCriteria = $this->searchCriteriaBuilder->setCurrentPage(1)->setPageSize(10)->create();
+ $searchData = $searchCriteria->__toArray();
+ $requestData = ['searchCriteria' => $searchData];
$serviceInfo = [
'rest' => [
- 'resourcePath' => self::RESOURCE_PATH . '/search',
- 'httpMethod' => RestConfig::HTTP_METHOD_POST,
+ 'resourcePath' => self::RESOURCE_PATH . '/search' . '?' . http_build_query($requestData),
+ 'httpMethod' => RestConfig::HTTP_METHOD_GET,
],
'soap' => [
'service' => self::SERVICE_NAME,
@@ -613,8 +615,6 @@ public function testSearchCustomersMultipleFilterGroups()
'operation' => self::SERVICE_NAME . 'getList',
],
];
- $searchData = $searchCriteria->__toArray();
- $requestData = ['searchCriteria' => $searchData];
$searchResults = $this->_webApiCall($serviceInfo, $requestData);
$this->assertEquals(1, $searchResults['total_count']);
$this->assertEquals($customerData1[Customer::ID], $searchResults['items'][0][Customer::ID]);
@@ -630,6 +630,7 @@ public function testSearchCustomersMultipleFilterGroups()
$searchCriteria = $this->searchCriteriaBuilder->create();
$searchData = $searchCriteria->__toArray();
$requestData = ['searchCriteria' => $searchData];
+ $serviceInfo['rest']['resourcePath'] = self::RESOURCE_PATH . '/search' . '?' . http_build_query($requestData);
$searchResults = $this->_webApiCall($serviceInfo, $requestData);
$this->assertEquals(0, $searchResults['total_count']);
}
diff --git a/dev/tests/api-functional/testsuite/Magento/Customer/Api/GroupRepositoryTest.php b/dev/tests/api-functional/testsuite/Magento/Customer/Api/GroupRepositoryTest.php
index 862349c1cbe53..3fce0da996323 100644
--- a/dev/tests/api-functional/testsuite/Magento/Customer/Api/GroupRepositoryTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/Customer/Api/GroupRepositoryTest.php
@@ -937,10 +937,13 @@ public function testSearchGroups($filterField, $filterValue, $expectedResult)
->create();
$searchCriteriaBuilder->addFilter([$filter]);
+
+ $searchData = $searchCriteriaBuilder->create()->__toArray();
+ $requestData = ['searchCriteria' => $searchData];
$serviceInfo = [
'rest' => [
- 'resourcePath' => self::RESOURCE_PATH . "/search",
- 'httpMethod' => \Magento\Webapi\Model\Rest\Config::HTTP_METHOD_POST,
+ 'resourcePath' => self::RESOURCE_PATH . "/search" . '?' . http_build_query($requestData),
+ 'httpMethod' => \Magento\Webapi\Model\Rest\Config::HTTP_METHOD_GET,
],
'soap' => [
'service' => self::SERVICE_NAME,
@@ -949,9 +952,6 @@ public function testSearchGroups($filterField, $filterValue, $expectedResult)
],
];
- $searchData = $searchCriteriaBuilder->create()->__toArray();
- $requestData = ['searchCriteria' => $searchData];
-
$searchResult = $this->_webApiCall($serviceInfo, $requestData);
if (is_null($expectedResult)) {
diff --git a/dev/tests/api-functional/testsuite/Magento/Eav/Api/AttributeSetRepositoryTest.php b/dev/tests/api-functional/testsuite/Magento/Eav/Api/AttributeSetRepositoryTest.php
index 2a7024a290a29..b782936ce3fe4 100644
--- a/dev/tests/api-functional/testsuite/Magento/Eav/Api/AttributeSetRepositoryTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/Eav/Api/AttributeSetRepositoryTest.php
@@ -215,8 +215,8 @@ public function testGetList()
$serviceInfo = [
'rest' => [
- 'resourcePath' => '/V1/eav/attribute-sets/list',
- 'httpMethod' => RestConfig::HTTP_METHOD_PUT,
+ 'resourcePath' => '/V1/eav/attribute-sets/list' . '?' . http_build_query($searchCriteria),
+ 'httpMethod' => RestConfig::HTTP_METHOD_GET,
],
'soap' => [
'service' => 'eavAttributeSetRepositoryV1',
diff --git a/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/CreditmemoListTest.php b/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/CreditmemoListTest.php
index a3b4dd59b1c3a..e7350116fed1a 100644
--- a/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/CreditmemoListTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/CreditmemoListTest.php
@@ -72,7 +72,7 @@ public function testCreditmemoList()
$serviceInfo = [
'rest' => [
'resourcePath' => self::RESOURCE_PATH . '?' . http_build_query($requestData),
- 'httpMethod' => Config::HTTP_METHOD_PUT,
+ 'httpMethod' => Config::HTTP_METHOD_GET,
],
'soap' => [
'service' => self::SERVICE_READ_NAME,
diff --git a/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/InvoiceListTest.php b/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/InvoiceListTest.php
index ea0565c64bb88..ccf17baf350af 100644
--- a/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/InvoiceListTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/InvoiceListTest.php
@@ -57,7 +57,7 @@ public function testInvoiceList()
$serviceInfo = [
'rest' => [
'resourcePath' => self::RESOURCE_PATH . '?' . http_build_query($requestData),
- 'httpMethod' => Config::HTTP_METHOD_PUT,
+ 'httpMethod' => Config::HTTP_METHOD_GET,
],
'soap' => [
'service' => self::SERVICE_READ_NAME,
diff --git a/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/OrderListTest.php b/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/OrderListTest.php
index a0d9743fdbc4b..a716b3ef0eef5 100644
--- a/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/OrderListTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/OrderListTest.php
@@ -58,7 +58,7 @@ public function testOrderList()
$serviceInfo = [
'rest' => [
'resourcePath' => self::RESOURCE_PATH . '?' . http_build_query($requestData),
- 'httpMethod' => Config::HTTP_METHOD_PUT,
+ 'httpMethod' => Config::HTTP_METHOD_GET,
],
'soap' => [
'service' => self::SERVICE_READ_NAME,
diff --git a/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/ShipmentListTest.php b/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/ShipmentListTest.php
index b68d6900eab78..8ffe07ebe28ab 100644
--- a/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/ShipmentListTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/ShipmentListTest.php
@@ -50,7 +50,7 @@ public function testShipmentList()
$serviceInfo = [
'rest' => [
'resourcePath' => self::RESOURCE_PATH . '?' . http_build_query($requestData),
- 'httpMethod' => Config::HTTP_METHOD_PUT,
+ 'httpMethod' => Config::HTTP_METHOD_GET,
],
'soap' => [
'service' => self::SERVICE_READ_NAME,
diff --git a/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/TransactionTest.php b/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/TransactionTest.php
index 2138fd6a6afa7..338b910cafe44 100644
--- a/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/TransactionTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/TransactionTest.php
@@ -113,7 +113,7 @@ public function testTransactionList($filters)
$serviceInfo = [
'rest' => [
'resourcePath' => self::RESOURCE_PATH . '?' . http_build_query($requestData),
- 'httpMethod' => Config::HTTP_METHOD_PUT,
+ 'httpMethod' => Config::HTTP_METHOD_GET,
],
'soap' => [
'service' => self::SERVICE_READ_NAME,
diff --git a/dev/tests/api-functional/testsuite/Magento/Tax/Api/TaxClassRepositoryTest.php b/dev/tests/api-functional/testsuite/Magento/Tax/Api/TaxClassRepositoryTest.php
index 4a462cbc3fb32..722aa6bd0aba7 100644
--- a/dev/tests/api-functional/testsuite/Magento/Tax/Api/TaxClassRepositoryTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/Tax/Api/TaxClassRepositoryTest.php
@@ -225,10 +225,12 @@ public function testSearchTaxClass()
->setValue($taxClassName)
->create();
$this->searchCriteriaBuilder->addFilter([$filter]);
+ $searchData = $this->searchCriteriaBuilder->create()->__toArray();
+ $requestData = ['searchCriteria' => $searchData];
$serviceInfo = [
'rest' => [
- 'resourcePath' => self::RESOURCE_PATH . '/search',
- 'httpMethod' => RestConfig::HTTP_METHOD_PUT,
+ 'resourcePath' => self::RESOURCE_PATH . '/search' . '?' . http_build_query($requestData),
+ 'httpMethod' => RestConfig::HTTP_METHOD_GET,
],
'soap' => [
'service' => self::SERVICE_NAME,
@@ -236,8 +238,6 @@ public function testSearchTaxClass()
'operation' => self::SERVICE_NAME . 'GetList',
],
];
- $searchData = $this->searchCriteriaBuilder->create()->__toArray();
- $requestData = ['searchCriteria' => $searchData];
$searchResults = $this->_webApiCall($serviceInfo, $requestData);
$this->assertEquals(1, $searchResults['total_count']);
$this->assertEquals($taxClassName, $searchResults['items'][0][$taxClassNameField]);
@@ -275,10 +275,12 @@ public function testSearchTaxClassMultipleFilterGroups()
$this->searchCriteriaBuilder->addFilter([$filter1, $filter2]);
$this->searchCriteriaBuilder->addFilter([$filter3, $filter4]);
$searchCriteria = $this->searchCriteriaBuilder->setCurrentPage(1)->setPageSize(10)->create();
+ $searchData = $searchCriteria->__toArray();
+ $requestData = ['searchCriteria' => $searchData];
$serviceInfo = [
'rest' => [
- 'resourcePath' => self::RESOURCE_PATH . '/search',
- 'httpMethod' => RestConfig::HTTP_METHOD_PUT,
+ 'resourcePath' => self::RESOURCE_PATH . '/search' . '?' . http_build_query($requestData),
+ 'httpMethod' => RestConfig::HTTP_METHOD_GET,
],
'soap' => [
'service' => self::SERVICE_NAME,
@@ -286,8 +288,6 @@ public function testSearchTaxClassMultipleFilterGroups()
'operation' => self::SERVICE_NAME . 'GetList',
],
];
- $searchData = $searchCriteria->__toArray();
- $requestData = ['searchCriteria' => $searchData];
$searchResults = $this->_webApiCall($serviceInfo, $requestData);
$this->assertEquals(2, $searchResults['total_count']);
$this->assertEquals($productTaxClass[Data\TaxClassInterface::KEY_NAME],
@@ -301,6 +301,7 @@ public function testSearchTaxClassMultipleFilterGroups()
$searchCriteria = $this->searchCriteriaBuilder->create();
$searchData = $searchCriteria->__toArray();
$requestData = ['searchCriteria' => $searchData];
+ $serviceInfo['rest']['resourcePath'] = self::RESOURCE_PATH . '/search' . '?' . http_build_query($requestData);
$searchResults = $this->_webApiCall($serviceInfo, $requestData);
$this->assertEquals(1, $searchResults['total_count']);
$this->assertEquals($customerTaxClass[Data\TaxClassInterface::KEY_NAME],
diff --git a/dev/tests/api-functional/testsuite/Magento/Tax/Api/TaxRateRepositoryTest.php b/dev/tests/api-functional/testsuite/Magento/Tax/Api/TaxRateRepositoryTest.php
index 0122bdfa3d7d1..63438bc489ac5 100644
--- a/dev/tests/api-functional/testsuite/Magento/Tax/Api/TaxRateRepositoryTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/Tax/Api/TaxRateRepositoryTest.php
@@ -432,10 +432,12 @@ public function testSearchTaxRates()
$this->searchCriteriaBuilder->addFilter([$filter]);
+ $searchData = $this->searchCriteriaBuilder->create()->__toArray();
+ $requestData = ['searchCriteria' => $searchData];
$serviceInfo = [
'rest' => [
- 'resourcePath' => self::RESOURCE_PATH . '/search',
- 'httpMethod' => \Magento\Webapi\Model\Rest\Config::HTTP_METHOD_PUT,
+ 'resourcePath' => self::RESOURCE_PATH . '/search' . '?' . http_build_query($requestData),
+ 'httpMethod' => \Magento\Webapi\Model\Rest\Config::HTTP_METHOD_GET,
],
'soap' => [
'service' => self::SERVICE_NAME,
@@ -443,8 +445,6 @@ public function testSearchTaxRates()
'operation' => self::SERVICE_NAME . 'GetList',
],
];
- $searchData = $this->searchCriteriaBuilder->create()->__toArray();
- $requestData = ['searchCriteria' => $searchData];
/** @var \Magento\Framework\Api\SearchResults $searchResults */
$searchResults = $this->_webApiCall($serviceInfo, $requestData);
@@ -483,10 +483,12 @@ public function testSearchTaxRatesCz()
// Order them by descending postcode (not the default order)
$this->searchCriteriaBuilder->addFilter([$filter])
->addSortOrder($sortOrder);
+ $searchData = $this->searchCriteriaBuilder->create()->__toArray();
+ $requestData = ['searchCriteria' => $searchData];
$serviceInfo = [
'rest' => [
- 'resourcePath' => self::RESOURCE_PATH . '/search',
- 'httpMethod' => \Magento\Webapi\Model\Rest\Config::HTTP_METHOD_PUT,
+ 'resourcePath' => self::RESOURCE_PATH . '/search' . '?' . http_build_query($requestData),
+ 'httpMethod' => \Magento\Webapi\Model\Rest\Config::HTTP_METHOD_GET,
],
'soap' => [
'service' => self::SERVICE_NAME,
@@ -494,8 +496,6 @@ public function testSearchTaxRatesCz()
'operation' => self::SERVICE_NAME . 'GetList',
],
];
- $searchData = $this->searchCriteriaBuilder->create()->__toArray();
- $requestData = ['searchCriteria' => $searchData];
/** @var \Magento\Framework\Api\SearchResults $searchResults */
$searchResults = $this->_webApiCall($serviceInfo, $requestData);
diff --git a/dev/tests/api-functional/testsuite/Magento/Tax/Api/TaxRuleRepositoryInterfaceTest.php b/dev/tests/api-functional/testsuite/Magento/Tax/Api/TaxRuleRepositoryInterfaceTest.php
index 277b0611d7acb..1453faca1daba 100644
--- a/dev/tests/api-functional/testsuite/Magento/Tax/Api/TaxRuleRepositoryInterfaceTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/Tax/Api/TaxRuleRepositoryInterfaceTest.php
@@ -268,10 +268,12 @@ public function testSearchTaxRulesSimple()
$fixtureRule = $this->getFixtureTaxRules()[1];
+ $searchData = $this->searchCriteriaBuilder->create()->__toArray();
+ $requestData = ['searchCriteria' => $searchData];
$serviceInfo = [
'rest' => [
- 'resourcePath' => self::RESOURCE_PATH . '/search',
- 'httpMethod' => \Magento\Webapi\Model\Rest\Config::HTTP_METHOD_PUT,
+ 'resourcePath' => self::RESOURCE_PATH . '/search' . '?' . http_build_query($requestData),
+ 'httpMethod' => \Magento\Webapi\Model\Rest\Config::HTTP_METHOD_GET,
],
'soap' => [
'service' => self::SERVICE_NAME,
@@ -279,8 +281,6 @@ public function testSearchTaxRulesSimple()
'operation' => self::SERVICE_NAME . 'GetList',
],
];
- $searchData = $this->searchCriteriaBuilder->create()->__toArray();
- $requestData = ['searchCriteria' => $searchData];
/** @var \Magento\Framework\Api\SearchResults $searchResults */
$searchResults = $this->_webApiCall($serviceInfo, $requestData);
@@ -323,10 +323,12 @@ public function testSearchTaxRulesCodeLike()
$fixtureRule = $this->getFixtureTaxRules()[1];
+ $searchData = $this->searchCriteriaBuilder->create()->__toArray();
+ $requestData = ['searchCriteria' => $searchData];
$serviceInfo = [
'rest' => [
- 'resourcePath' => self::RESOURCE_PATH . '/search',
- 'httpMethod' => \Magento\Webapi\Model\Rest\Config::HTTP_METHOD_PUT,
+ 'resourcePath' => self::RESOURCE_PATH . '/search' . '?' . http_build_query($requestData),
+ 'httpMethod' => \Magento\Webapi\Model\Rest\Config::HTTP_METHOD_GET,
],
'soap' => [
'service' => self::SERVICE_NAME,
@@ -334,8 +336,6 @@ public function testSearchTaxRulesCodeLike()
'operation' => self::SERVICE_NAME . 'GetList',
],
];
- $searchData = $this->searchCriteriaBuilder->create()->__toArray();
- $requestData = ['searchCriteria' => $searchData];
/** @var \Magento\Framework\Api\SearchResults $searchResults */
$searchResults = $this->_webApiCall($serviceInfo, $requestData);
@@ -513,10 +513,17 @@ public function testSearchTaxRule()
{
$fixtureRule = $this->getFixtureTaxRules()[0];
+
+ $filter = $this->filterBuilder->setField('code')
+ ->setValue($fixtureRule->getCode())
+ ->create();
+ $this->searchCriteriaBuilder->addFilter([$filter]);
+ $searchData = $this->searchCriteriaBuilder->create()->__toArray();
+ $requestData = ['searchCriteria' => $searchData];
$serviceInfo = [
'rest' => [
- 'resourcePath' => self::RESOURCE_PATH . '/search',
- 'httpMethod' => \Magento\Webapi\Model\Rest\Config::HTTP_METHOD_PUT,
+ 'resourcePath' => self::RESOURCE_PATH . '/search' . '?' . http_build_query($requestData),
+ 'httpMethod' => \Magento\Webapi\Model\Rest\Config::HTTP_METHOD_GET,
],
'soap' => [
'service' => self::SERVICE_NAME,
@@ -524,13 +531,6 @@ public function testSearchTaxRule()
'operation' => self::SERVICE_NAME . 'GetList',
],
];
-
- $filter = $this->filterBuilder->setField('code')
- ->setValue($fixtureRule->getCode())
- ->create();
- $this->searchCriteriaBuilder->addFilter([$filter]);
- $searchData = $this->searchCriteriaBuilder->create()->__toArray();
- $requestData = ['searchCriteria' => $searchData];
$searchResults = $this->_webApiCall($serviceInfo, $requestData);
$this->assertEquals(1, $searchResults['total_count']);
$this->assertEquals($fixtureRule->getId(), $searchResults['items'][0]["id"]);