Skip to content

Commit 1acce35

Browse files
committed
Merge remote-tracking branch 'tango/MAGETWO-98853' into tango-PR-04
2 parents 3290565 + a56559c commit 1acce35

File tree

3 files changed

+30
-15
lines changed

3 files changed

+30
-15
lines changed

app/code/Magento/NewRelicReporting/Model/Module/Collect.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -277,9 +277,7 @@ public function getModuleData($refresh = true)
277277
$changes = array_diff($module, $changeTest);
278278
$changesCleanArray = $this->getCleanChangesArray($changes);
279279

280-
if (count($changesCleanArray) > 0 ||
281-
($this->moduleManager->isOutputEnabled($changeTest['name']) &&
282-
$module['setup_version'] != null)) {
280+
if (!empty($changesCleanArray)) {
283281
$data = [
284282
'entity_id' => $changeTest['entity_id'],
285283
'name' => $changeTest['name'],

app/code/Magento/NewRelicReporting/Test/Unit/Model/Module/CollectTest.php

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -162,10 +162,6 @@ public function testGetModuleDataWithoutRefresh()
162162
->method('getNames')
163163
->willReturn($enabledModulesMockArray);
164164

165-
$this->moduleManagerMock->expects($this->any())->method('isOutputEnabled')->will(
166-
$this->returnValue(false)
167-
);
168-
169165
$this->assertInternalType(
170166
'array',
171167
$this->model->getModuleData()
@@ -256,10 +252,6 @@ public function testGetModuleDataRefresh($data)
256252
->method('getNames')
257253
->willReturn($enabledModulesMockArray);
258254

259-
$this->moduleManagerMock->expects($this->any())->method('isOutputEnabled')->will(
260-
$this->returnValue(true)
261-
);
262-
263255
$this->assertInternalType(
264256
'array',
265257
$this->model->getModuleData()
@@ -350,10 +342,6 @@ public function testGetModuleDataRefreshOrStatement($data)
350342
->method('getNames')
351343
->willReturn($enabledModulesMockArray);
352344

353-
$this->moduleManagerMock->expects($this->any())->method('isOutputEnabled')->will(
354-
$this->returnValue(true)
355-
);
356-
357345
$this->assertInternalType(
358346
'array',
359347
$this->model->getModuleData()
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
namespace Magento\NewRelicReporting\Model\Module;
7+
8+
use Magento\TestFramework\Helper\Bootstrap;
9+
use PHPUnit\Framework\TestCase;
10+
11+
class CollectTest extends TestCase
12+
{
13+
/**
14+
* @var Collect
15+
*/
16+
private $collect;
17+
18+
protected function setUp()
19+
{
20+
$this->collect = Bootstrap::getObjectManager()->create(Collect::class);
21+
}
22+
23+
public function testReport()
24+
{
25+
$this->collect->getModuleData();
26+
$moduleData = $this->collect->getModuleData();
27+
$this->assertEmpty($moduleData['changes']);
28+
}
29+
}

0 commit comments

Comments
 (0)