File tree Expand file tree Collapse file tree
app/code/Magento/Reports/Model/ResourceModel/Review/Customer
dev/tests/integration/testsuite/Magento/Reports/Model/ResourceModel/Review/Customer Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -110,13 +110,14 @@ protected function _joinCustomers()
110110 */
111111 public function getSelectCountSql ()
112112 {
113- $ countSelect = clone $ this ->_select ;
113+ $ countSelect = clone $ this ->getSelect () ;
114114 $ countSelect ->reset (\Magento \Framework \DB \Select::ORDER );
115115 $ countSelect ->reset (\Magento \Framework \DB \Select::GROUP );
116116 $ countSelect ->reset (\Magento \Framework \DB \Select::HAVING );
117117 $ countSelect ->reset (\Magento \Framework \DB \Select::LIMIT_COUNT );
118118 $ countSelect ->reset (\Magento \Framework \DB \Select::LIMIT_OFFSET );
119119 $ countSelect ->reset (\Magento \Framework \DB \Select::COLUMNS );
120+ $ countSelect ->reset (\Magento \Framework \DB \Select::WHERE );
120121
121122 $ countSelect ->columns (new \Zend_Db_Expr ('COUNT(DISTINCT detail.customer_id) ' ));
122123
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 \Reports \Model \ResourceModel \Review \Customer ;
7+
8+ /**
9+ * @magentoAppArea adminhtml
10+ */
11+ class CollectionTest extends \PHPUnit \Framework \TestCase
12+ {
13+ /**
14+ * @var \Magento\Reports\Model\ResourceModel\Review\Customer\Collection
15+ */
16+ private $ collection ;
17+
18+ protected function setUp ()
19+ {
20+ $ this ->collection = \Magento \TestFramework \Helper \Bootstrap::getObjectManager ()->create (
21+ \Magento \Reports \Model \ResourceModel \Review \Customer \Collection::class
22+ );
23+ }
24+
25+ /**
26+ * This tests covers issue described in:
27+ * https://github.com/magento/magento2/issues/10301
28+ *
29+ * @magentoDataFixture Magento/Review/_files/customer_review.php
30+ */
31+ public function testSelectCountSql ()
32+ {
33+ $ this ->collection ->addFieldToFilter ('customer_name ' , ['like ' => '%john% ' ]);
34+ $ this ->assertEquals (1 , $ this ->collection ->getSize ());
35+ }
36+ }
You can’t perform that action at this time.
0 commit comments