File tree Expand file tree Collapse file tree 3 files changed +25
-13
lines changed
dev/tests/integration/testsuite/Magento/Catalog/Model Expand file tree Collapse file tree 3 files changed +25
-13
lines changed Original file line number Diff line number Diff line change @@ -530,19 +530,6 @@ public function getStoreId()
530
530
return $ this ->_storeManager ->getStore ()->getId ();
531
531
}
532
532
533
- /**
534
- * Get collection instance
535
- *
536
- * @return object
537
- * @deprecated 101.1.0 because collections should be used directly via factory
538
- */
539
- public function getResourceCollection ()
540
- {
541
- $ collection = parent ::getResourceCollection ();
542
- $ collection ->setStoreId ($ this ->getStoreId ());
543
- return $ collection ;
544
- }
545
-
546
533
/**
547
534
* Get product url model
548
535
*
Original file line number Diff line number Diff line change 859
859
<argument name =" customFilters" xsi : type =" array" >
860
860
<item name =" category_id" xsi : type =" object" >Magento\Catalog\Model\Api\SearchCriteria\CollectionProcessor\FilterProcessor\ProductCategoryFilter</item >
861
861
<item name =" store" xsi : type =" object" >Magento\Catalog\Model\Api\SearchCriteria\CollectionProcessor\FilterProcessor\ProductStoreFilter</item >
862
+ <item name =" store_id" xsi : type =" object" >Magento\Catalog\Model\Api\SearchCriteria\CollectionProcessor\FilterProcessor\ProductStoreFilter</item >
862
863
<item name =" website_id" xsi : type =" object" >Magento\Catalog\Model\Api\SearchCriteria\CollectionProcessor\FilterProcessor\ProductWebsiteFilter</item >
863
864
</argument >
864
865
</arguments >
Original file line number Diff line number Diff line change @@ -30,6 +30,11 @@ class ProductRepositoryTest extends \PHPUnit\Framework\TestCase
30
30
*/
31
31
private $ productResource ;
32
32
33
+ /**
34
+ * @var \Magento\Framework\Api\SearchCriteriaBuilder
35
+ */
36
+ private $ searchCriteriaBuilder ;
37
+
33
38
/**
34
39
* @inheritdoc
35
40
*/
@@ -39,6 +44,8 @@ protected function setUp()
39
44
->get (ProductRepositoryInterface::class);
40
45
$ this ->productResource = Bootstrap::getObjectManager ()
41
46
->get (ProductResource::class);
47
+ $ this ->searchCriteriaBuilder = Bootstrap::getObjectManager ()
48
+ ->create (\Magento \Framework \Api \SearchCriteriaBuilder::class);
42
49
}
43
50
44
51
/**
@@ -174,4 +181,21 @@ public function skuDataProvider(): array
174
181
['sku ' => 'simple ' ]
175
182
];
176
183
}
184
+
185
+ /**
186
+ * Checks filtering by store_id.
187
+ *
188
+ * @magentoDataFixture Magento/Catalog/Model/ResourceModel/_files/product_simple.php
189
+ * @return void
190
+ */
191
+ public function testFilterByStoreId ()
192
+ {
193
+ $ searchCriteria = $ this ->searchCriteriaBuilder
194
+ ->addFilter ('store_id ' , '1 ' , 'eq ' )
195
+ ->create ();
196
+ $ list = $ this ->productRepository ->getList ($ searchCriteria );
197
+ $ count = $ list ->getTotalCount ();
198
+
199
+ $ this ->assertGreaterThanOrEqual (1 , $ count );
200
+ }
177
201
}
You can’t perform that action at this time.
0 commit comments