File tree Expand file tree Collapse file tree 3 files changed +17
-3
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 +17
-3
lines changed Original file line number Diff line number Diff line change @@ -222,7 +222,7 @@ public function setInAllAttributeSetsFilter(array $setIds)
222222 $ setIds
223223 )
224224 ->group ('entity_attribute.attribute_id ' )
225- ->having (' count = ' . count ($ setIds ));
225+ ->having (new \ Zend_Db_Expr ( ' COUNT(*) ' ) . ' = ' . count ($ setIds ));
226226 }
227227
228228 //$this->getSelect()->distinct(true);
Original file line number Diff line number Diff line change @@ -150,8 +150,8 @@ public function testSetInAllAttributeSetsFilter()
150150 $ this ->selectMock ->expects ($ this ->atLeastOnce ())->method ('group ' )->with ('entity_attribute.attribute_id ' )
151151 ->willReturnSelf ();
152152
153- $ this ->selectMock ->expects ($ this ->atLeastOnce ())->method ('having ' )-> with ( ' count = ' . count ( $ setIds ))
154- ->willReturnSelf ();
153+ $ this ->selectMock ->expects ($ this ->atLeastOnce ())->method ('having ' )
154+ ->with ( new \ Zend_Db_Expr ( ' COUNT(*) ' ) . ' = ' . count ( $ setIds ))-> willReturnSelf ();
155155
156156 $ this ->model ->setInAllAttributeSetsFilter ($ setIds );
157157 }
Original file line number Diff line number Diff line change @@ -52,6 +52,20 @@ public function testSetAttributeGroupFilter()
5252 $ this ->assertEquals ([$ includeGroupId ], $ groups );
5353 }
5454
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+
5569 /**
5670 * Returns array of group ids, present in collection attributes
5771 *
You can’t perform that action at this time.
0 commit comments