Skip to content

Commit 054c3ea

Browse files
Merge remote-tracking branch 'mainline/develop' into MAGETWO-33401
2 parents c27662b + 2c52e17 commit 054c3ea

File tree

3 files changed

+34
-7
lines changed

3 files changed

+34
-7
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+
}

dev/tests/static/testsuite/Magento/Test/Integrity/ClassesTest.php

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -534,9 +534,16 @@ public function testCoversAnnotation()
534534
$errors = [];
535535
foreach ($files->getFiles([BP . '/dev/tests/{integration,unit}'], '*') as $file) {
536536
$code = file_get_contents($file);
537-
if (preg_match('/@covers(DefaultClass)?\s+([\w\\\\]+)(::([\w\\\\]+))?/', $code, $matches)) {
538-
if ($this->isNonexistentEntityCovered($matches)) {
539-
$errors[] = $file . ': ' . $matches[0];
537+
if (preg_match_all(
538+
'/@covers(DefaultClass)?\s+([\w\\\\]+)(::([\w\\\\]+))?/',
539+
$code,
540+
$matchesAll,
541+
PREG_SET_ORDER
542+
)) {
543+
foreach ($matchesAll as $matches) {
544+
if ($this->isNonexistentEntityCovered($matches)) {
545+
$errors[] = $file . ': ' . $matches[0];
546+
}
540547
}
541548
}
542549
}

0 commit comments

Comments
 (0)