File tree Expand file tree Collapse file tree 2 files changed +31
-0
lines changed
app/code/Magento/User/Model/ResourceModel/User
dev/tests/integration/testsuite/Magento/User/Model/ResourceModel/User Expand file tree Collapse file tree 2 files changed +31
-0
lines changed Original file line number Diff line number Diff line change @@ -41,5 +41,6 @@ protected function _initSelect()
41
41
'user_role.parent_id = detail_role.role_id ' ,
42
42
['role_name ' ]
43
43
);
44
+ $ this ->addFilterToMap ('user_id ' , 'main_table.user_id ' );
44
45
}
45
46
}
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
+ namespace Magento \User \Model \ResourceModel \User ;
7
+
8
+ /**
9
+ * User collection test
10
+ * @magentoAppArea adminhtml
11
+ */
12
+ class CollectionTest extends \PHPUnit \Framework \TestCase
13
+ {
14
+ /**
15
+ * @var \Magento\User\Model\ResourceModel\User\Collection
16
+ */
17
+ protected $ _collection ;
18
+
19
+ protected function setUp (): void
20
+ {
21
+ $ this ->_collection = \Magento \TestFramework \Helper \Bootstrap::getObjectManager ()->create (
22
+ \Magento \User \Model \ResourceModel \User \Collection::class
23
+ );
24
+ }
25
+
26
+ public function testFilteringCollectionByUserId ()
27
+ {
28
+ $ this ->assertEquals (1 , $ this ->_collection ->addFieldToFilter ('user_id ' , 1 )->count ());
29
+ }
30
+ }
You can’t perform that action at this time.
0 commit comments