Skip to content

Commit 58aeb2c

Browse files
author
Roman Ganin
committed
Merge remote-tracking branch 'origin/MAGETWO-33894' into develop
2 parents d787e11 + 9127e35 commit 58aeb2c

File tree

2 files changed

+24
-4
lines changed

2 files changed

+24
-4
lines changed

app/code/Magento/Reports/Model/Resource/Product/Collection.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -434,10 +434,7 @@ public function addViewsCount($from = '', $to = '')
434434
['views' => 'COUNT(report_table_views.event_id)']
435435
)->join(
436436
['e' => $this->getProductEntityTableName()],
437-
$this->getConnection()->quoteInto(
438-
"e.entity_id = report_table_views.object_id AND e.entity_type_id = ?",
439-
$this->getProductEntityTypeId()
440-
)
437+
'e.entity_id = report_table_views.object_id'
441438
)->where(
442439
'report_table_views.event_type_id = ?',
443440
$productViewEvent
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?php
2+
/**
3+
*
4+
* Copyright © 2015 Magento. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
namespace Magento\Backend\Controller\Adminhtml\Dashboard;
8+
9+
class ProductsViewedTest extends \Magento\Backend\Utility\Controller
10+
{
11+
/**
12+
* @magentoDataFixture Magento/Reports/_files/viewed_products.php
13+
*/
14+
public function testExecute()
15+
{
16+
$this->dispatch('backend/admin/dashboard/productsViewed/');
17+
18+
$this->assertEquals(200, $this->getResponse()->getHttpResponseCode());
19+
20+
$actual = $this->getResponse()->getBody();
21+
$this->assertContains('Simple Product', $actual);
22+
}
23+
}

0 commit comments

Comments
 (0)