File tree Expand file tree Collapse file tree 3 files changed +16
-2
lines changed
Model/ResourceModel/Entity/Attribute
Test/Unit/Model/ResourceModel/Entity/Attribute
dev/tests/integration/testsuite/Magento/Eav/Model/ResourceModel/Entity/Attribute Expand file tree Collapse file tree 3 files changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -222,7 +222,7 @@ public function setInAllAttributeSetsFilter(array $setIds)
222
222
$ setIds
223
223
)
224
224
->group ('entity_attribute.attribute_id ' )
225
- ->having (' count = ' . count ($ setIds ));
225
+ ->having (new \ Zend_Db_Expr ( ' COUNT(*) ' ) . ' = ' . count ($ setIds ));
226
226
}
227
227
228
228
//$this->getSelect()->distinct(true);
Original file line number Diff line number Diff line change @@ -150,7 +150,7 @@ public function testSetInAllAttributeSetsFilter()
150
150
$ this ->selectMock ->expects ($ this ->atLeastOnce ())->method ('group ' )->with ('entity_attribute.attribute_id ' )
151
151
->willReturnSelf ();
152
152
153
- $ this ->selectMock ->expects ($ this ->atLeastOnce ())->method ('having ' )->with (' count = ' . count ($ setIds ))
153
+ $ this ->selectMock ->expects ($ this ->atLeastOnce ())->method ('having ' )->with (new \ Zend_Db_Expr ( ' COUNT(*) ' ) . ' = ' . count ($ setIds ))
154
154
->willReturnSelf ();
155
155
156
156
$ this ->model ->setInAllAttributeSetsFilter ($ setIds );
Original file line number Diff line number Diff line change @@ -52,6 +52,20 @@ public function testSetAttributeGroupFilter()
52
52
$ this ->assertEquals ([$ includeGroupId ], $ groups );
53
53
}
54
54
55
+ /**
56
+ * Test if getAllIds method return results after using setInAllAttributeSetsFilter method
57
+ *
58
+ * @covers \Magento\Eav\Model\ResourceModel\Entity\Attribute\Collection::setInAllAttributeSetsFilter()
59
+ * @covers \Magento\Eav\Model\ResourceModel\Entity\Attribute\Collection::getAllIds()
60
+ */
61
+ public function testSetInAllAttributeSetsFilterWithGetAllIds ()
62
+ {
63
+ $ sets = [1 ];
64
+ $ this ->_model ->setInAllAttributeSetsFilter ($ sets );
65
+ $ attributeIds = $ this ->_model ->getAllIds ();
66
+ $ this ->assertGreaterThan (0 , count ($ attributeIds ));
67
+ }
68
+
55
69
/**
56
70
* Returns array of group ids, present in collection attributes
57
71
*
You can’t perform that action at this time.
0 commit comments