Skip to content

Commit

Permalink
MAGETWO-91620: It is not possible to use function setInAllAttributeSe…
Browse files Browse the repository at this point in the history
…tsFilter() together with getAllIds() for class Magento\Catalog\Model\ResourceModel\Product\Attribute\Collection

- Modified having clause to use aggregation function instead of alias
  • Loading branch information
oksana-kr committed Aug 8, 2018
1 parent 0e2bca6 commit d93e5c7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ public function setInAllAttributeSetsFilter(array $setIds)
$setIds
)
->group('entity_attribute.attribute_id')
->having('count = ' . count($setIds));
->having(new \Zend_Db_Expr('COUNT(*)') . ' = ' . count($setIds));
}

//$this->getSelect()->distinct(true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ public function testSetInAllAttributeSetsFilter()
$this->selectMock->expects($this->atLeastOnce())->method('group')->with('entity_attribute.attribute_id')
->willReturnSelf();

$this->selectMock->expects($this->atLeastOnce())->method('having')->with('count = ' . count($setIds))
$this->selectMock->expects($this->atLeastOnce())->method('having')->with(new \Zend_Db_Expr('COUNT(*)') . ' = ' . count($setIds))
->willReturnSelf();

$this->model->setInAllAttributeSetsFilter($setIds);
Expand Down

0 comments on commit d93e5c7

Please sign in to comment.