@@ -552,7 +552,6 @@ public function testQueryProductsInCurrentPageSortedByPriceASC()
552
552
* Verify the items in the second page is correct after sorting their name in ASC order
553
553
*
554
554
* @magentoApiDataFixture Magento/Catalog/_files/multiple_mixed_products_2.php
555
- * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
556
555
*/
557
556
public function testFilterProductsInNextPageSortedByNameASC ()
558
557
{
@@ -562,58 +561,43 @@ public function testFilterProductsInNextPageSortedByNameASC()
562
561
products(
563
562
filter:
564
563
{
565
- price:{gt: "5", lt: "50"}
566
- or:
567
- {
568
- sku:{eq:"simple1"}
569
- name:{like:"configurable%"}
570
- }
564
+ sku:{in:["simple2", "simple1"]}
571
565
}
572
- pageSize:4
566
+ pageSize:1
573
567
currentPage:2
574
568
sort:
575
569
{
576
- name:ASC
570
+ name:ASC
577
571
}
578
572
)
579
573
{
580
574
items
581
575
{
582
576
sku
583
- price {
584
- minimalPrice {
585
- amount {
586
- value
587
- currency
588
- }
589
- }
590
- }
591
577
name
592
- type_id
593
- ... on PhysicalProductInterface {
594
- weight
595
- }
596
- attribute_set_id
597
- }
598
- total_count
599
- page_info
600
- {
578
+ }
579
+ total_count
580
+ page_info
581
+ {
601
582
page_size
602
- }
583
+ current_page
584
+ }
603
585
}
604
586
}
605
587
QUERY ;
606
588
/**
607
589
* @var ProductRepositoryInterface $productRepository
608
590
*/
609
591
$ productRepository = ObjectManager::getInstance ()->get (ProductRepositoryInterface::class);
610
- $ product = $ productRepository ->get ('simple1 ' );
611
- $ filteredProducts = [$ product ];
592
+ $ product = $ productRepository ->get ('simple2 ' );
612
593
613
594
$ response = $ this ->graphQlQuery ($ query );
614
- $ this ->assertEquals (1 , $ response ['products ' ]['total_count ' ]);
615
- $ this ->assertProductItems ($ filteredProducts , $ response );
616
- $ this ->assertEquals (4 , $ response ['products ' ]['page_info ' ]['page_size ' ]);
595
+ $ this ->assertEquals (2 , $ response ['products ' ]['total_count ' ]);
596
+ $ this ->assertEquals (['page_size ' => 1 , 'current_page ' => 2 ], $ response ['products ' ]['page_info ' ]);
597
+ $ this ->assertEquals (
598
+ [['sku ' => $ product ->getSku (), 'name ' => $ product ->getName ()]],
599
+ $ response ['products ' ]['items ' ]
600
+ );
617
601
}
618
602
619
603
/**
0 commit comments