File tree 2 files changed +38
-1
lines changed
app/code/Magento/Reports/Model/ResourceModel/Review/Customer
dev/tests/integration/testsuite/Magento/Reports/Model/ResourceModel/Review/Customer
2 files changed +38
-1
lines changed Original file line number Diff line number Diff line change @@ -110,13 +110,14 @@ protected function _joinCustomers()
110
110
*/
111
111
public function getSelectCountSql ()
112
112
{
113
- $ countSelect = clone $ this ->_select ;
113
+ $ countSelect = clone $ this ->getSelect () ;
114
114
$ countSelect ->reset (\Magento \Framework \DB \Select::ORDER );
115
115
$ countSelect ->reset (\Magento \Framework \DB \Select::GROUP );
116
116
$ countSelect ->reset (\Magento \Framework \DB \Select::HAVING );
117
117
$ countSelect ->reset (\Magento \Framework \DB \Select::LIMIT_COUNT );
118
118
$ countSelect ->reset (\Magento \Framework \DB \Select::LIMIT_OFFSET );
119
119
$ countSelect ->reset (\Magento \Framework \DB \Select::COLUMNS );
120
+ $ countSelect ->reset (\Magento \Framework \DB \Select::WHERE );
120
121
121
122
$ countSelect ->columns (new \Zend_Db_Expr ('COUNT(DISTINCT detail.customer_id) ' ));
122
123
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