File tree Expand file tree Collapse file tree 3 files changed +52
-13
lines changed
dev/tests/integration/testsuite/Magento/Catalog/Model Expand file tree Collapse file tree 3 files changed +52
-13
lines changed Original file line number Diff line number Diff line change @@ -513,19 +513,6 @@ public function getStoreId()
513
513
return $ this ->_storeManager ->getStore ()->getId ();
514
514
}
515
515
516
- /**
517
- * Get collection instance
518
- *
519
- * @return object
520
- * @deprecated 101.1.0 because collections should be used directly via factory
521
- */
522
- public function getResourceCollection ()
523
- {
524
- $ collection = parent ::getResourceCollection ();
525
- $ collection ->setStoreId ($ this ->getStoreId ());
526
- return $ collection ;
527
- }
528
-
529
516
/**
530
517
* Get product url model
531
518
*
Original file line number Diff line number Diff line change 865
865
<argument name =" customFilters" xsi : type =" array" >
866
866
<item name =" category_id" xsi : type =" object" >Magento\Catalog\Model\Api\SearchCriteria\CollectionProcessor\FilterProcessor\ProductCategoryFilter</item >
867
867
<item name =" store" xsi : type =" object" >Magento\Catalog\Model\Api\SearchCriteria\CollectionProcessor\FilterProcessor\ProductStoreFilter</item >
868
+ <item name =" store_id" xsi : type =" object" >Magento\Catalog\Model\Api\SearchCriteria\CollectionProcessor\FilterProcessor\ProductStoreFilter</item >
868
869
<item name =" website_id" xsi : type =" object" >Magento\Catalog\Model\Api\SearchCriteria\CollectionProcessor\FilterProcessor\ProductWebsiteFilter</item >
869
870
</argument >
870
871
</arguments >
Original file line number Diff line number Diff line change
1
+ <?php
2
+ /**
3
+ * Copyright © Magento, Inc. All rights reserved.
4
+ * See COPYING.txt for license details.
5
+ */
6
+ declare (strict_types=1 );
7
+
8
+ namespace Magento \Catalog \Model ;
9
+
10
+ class ProductRepositoryTest extends \PHPUnit \Framework \TestCase
11
+ {
12
+ /**
13
+ * @var \Magento\Catalog\Api\ProductRepositoryInterface
14
+ */
15
+ private $ productRepository ;
16
+
17
+ /**
18
+ * @var \Magento\Framework\Api\SearchCriteriaBuilder
19
+ */
20
+ private $ searchCriteriaBuilder ;
21
+
22
+ /**
23
+ * Sets up common objects
24
+ */
25
+ protected function setUp ()
26
+ {
27
+ $ this ->productRepository = \Magento \Framework \App \ObjectManager::getInstance ()->create (
28
+ \Magento \Catalog \Api \ProductRepositoryInterface::class
29
+ );
30
+
31
+ $ this ->searchCriteriaBuilder = \Magento \Framework \App \ObjectManager::getInstance ()->create (
32
+ \Magento \Framework \Api \SearchCriteriaBuilder::class
33
+ );
34
+ }
35
+
36
+ /**
37
+ * Checks filtering by store_id
38
+ *
39
+ * @magentoDataFixture Magento/Catalog/Model/ResourceModel/_files/product_simple.php
40
+ */
41
+ public function testFilterByStoreId ()
42
+ {
43
+ $ searchCriteria = $ this ->searchCriteriaBuilder
44
+ ->addFilter ('store_id ' , '1 ' , 'eq ' )
45
+ ->create ();
46
+ $ list = $ this ->productRepository ->getList ($ searchCriteria );
47
+ $ count = $ list ->getTotalCount ();
48
+
49
+ $ this ->assertGreaterThanOrEqual (1 , $ count );
50
+ }
51
+ }
You can’t perform that action at this time.
0 commit comments