File tree Expand file tree Collapse file tree 2 files changed +10
-5
lines changed
app/code/Magento/GraphQlCatalog/Model/Resolver/Products/Query
dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog Expand file tree Collapse file tree 2 files changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -65,9 +65,10 @@ public function getResult(SearchCriteriaInterface $searchCriteria)
65
65
{
66
66
$ realPageSize = $ searchCriteria ->getPageSize ();
67
67
$ realCurrentPage = $ searchCriteria ->getCurrentPage ();
68
+ // Current page must be set to 0 and page size to max for search to grab all ID's as temporary workaround
69
+ // for MAGETWO-85611
68
70
$ searchCriteria ->setPageSize (PHP_INT_MAX );
69
- // Search starts pages from 0, whereas filtering starts at 1. GraphQL's query starts at 1, so it must be altered
70
- $ searchCriteria ->setCurrentPage ($ realCurrentPage - 1 );
71
+ $ searchCriteria ->setCurrentPage (0 );
71
72
$ itemsResults = $ this ->search ->search ($ searchCriteria );
72
73
73
74
$ ids = [];
Original file line number Diff line number Diff line change @@ -151,7 +151,9 @@ public function testFilterVisibleProductsWithMatchingSkuOrNameWithSpecialPrice()
151
151
* pageSize = total_count and current page = 2
152
152
* expected - error is thrown
153
153
* Actual - empty array
154
- * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
154
+ * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
155
+ *
156
+ * @magentoApiDataFixture Magento/Catalog/_files/multiple_products.php
155
157
*/
156
158
157
159
public function testSearchWithFilterWithPageSizeEqualTotalCount ()
@@ -208,8 +210,10 @@ public function testSearchWithFilterWithPageSizeEqualTotalCount()
208
210
}
209
211
210
212
/**
211
- the query returns a total_count of 2 records; setting the pageSize = 1 and currentPage2
213
+ * The query returns a total_count of 2 records; setting the pageSize = 1 and currentPage2
212
214
* Expected result is to get the second product from the list on the second page
215
+ *
216
+ * @magentoApiDataFixture Magento/Catalog/_files/multiple_products.php
213
217
*/
214
218
public function testSearchWithFilterPageSizeLessThanCurrentPage ()
215
219
{
@@ -262,7 +266,7 @@ public function testSearchWithFilterPageSizeLessThanCurrentPage()
262
266
* @var ProductRepositoryInterface $productRepository
263
267
*/
264
268
$ productRepository = ObjectManager::getInstance ()->get (ProductRepositoryInterface::class);
265
- $ product = $ productRepository ->get ('simple1 ' );
269
+ $ product = $ productRepository ->get ('simple2 ' );
266
270
$ filteredProducts = [$ product ];
267
271
268
272
$ response = $ this ->graphQlQuery ($ query );
You can’t perform that action at this time.
0 commit comments