Skip to content

Commit 6582d1f

Browse files
committed
AC-15461:Migration New Relic from REST v2 to NerdGraph (GraphQL)
1 parent d15db21 commit 6582d1f

File tree

2 files changed

+3
-59
lines changed

2 files changed

+3
-59
lines changed

app/code/Magento/NewRelicReporting/Test/Unit/ViewModel/BrowserMonitoringFooterJsTest.php

Lines changed: 2 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,8 @@
77

88
namespace Magento\NewRelicReporting\Test\Unit\ViewModel;
99

10-
use Magento\Framework\View\Element\Block\ArgumentInterface;
1110
use Magento\NewRelicReporting\Model\NewRelicWrapper;
1211
use Magento\NewRelicReporting\ViewModel\BrowserMonitoringFooterJs;
13-
use Magento\NewRelicReporting\ViewModel\ContentProviderInterface;
1412
use PHPUnit\Framework\MockObject\Exception;
1513
use PHPUnit\Framework\MockObject\MockObject;
1614
use PHPUnit\Framework\TestCase;
@@ -49,8 +47,8 @@ public static function getContentDataProvider(): array
4947
{
5048
return [
5149
'enabled_with_content' => [true,
52-
'<script>/* NewRelic footer code */</script>',
53-
'<script>/* NewRelic footer code */</script>'
50+
'<script>/* NewRelic Footer code */</script>',
51+
'<script>/* NewRelic Footer code */</script>'
5452
],
5553
'enabled_with_null' => [true, null, null],
5654
'enabled_with_empty' => [true, '', ''],
@@ -96,58 +94,4 @@ public function testGetContentCallsBrowserTimingFooterWithCorrectParameter(): vo
9694

9795
$this->viewModel->getContent();
9896
}
99-
100-
/**
101-
* Test that the class implements ArgumentInterface
102-
*
103-
* @return void
104-
*/
105-
public function testImplementsArgumentInterface(): void
106-
{
107-
$this->assertInstanceOf(ArgumentInterface::class, $this->viewModel);
108-
}
109-
110-
/**
111-
* Test that the class implements ContentProviderInterface
112-
*
113-
* @return void
114-
*/
115-
public function testImplementsContentProviderInterface(): void
116-
{
117-
$this->assertInstanceOf(ContentProviderInterface::class, $this->viewModel);
118-
}
119-
120-
/**
121-
* Test constructor dependency injection
122-
*
123-
* @return void
124-
*/
125-
public function testConstructorSetsNewRelicWrapperDependency(): void
126-
{
127-
$wrapper = $this->createMock(NewRelicWrapper::class);
128-
$viewModel = new BrowserMonitoringFooterJs($wrapper);
129-
130-
// Test that the dependency is properly injected by testing behavior
131-
$wrapper->method('isAutoInstrumentEnabled')->willReturn(false);
132-
$result = $viewModel->getContent();
133-
134-
$this->assertNull($result);
135-
}
136-
137-
/**
138-
* Test getBrowserTimingFooter is never called when auto-instrument is disabled
139-
*
140-
* @return void
141-
*/
142-
public function testGetBrowserTimingFooterNeverCalledWhenDisabled(): void
143-
{
144-
$this->newRelicWrapperMock->expects($this->once())
145-
->method('isAutoInstrumentEnabled')
146-
->willReturn(false);
147-
148-
$this->newRelicWrapperMock->expects($this->never())
149-
->method('getBrowserTimingFooter');
150-
151-
$this->viewModel->getContent();
152-
}
15397
}

app/code/Magento/NewRelicReporting/Test/Unit/ViewModel/BrowserMonitoringHeaderJsTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ public function testGetContent(bool $isEnabled, ?string $headerContent, ?string
8181
*
8282
* @return void
8383
*/
84-
public function testGetContentCallsBrowserTimingFooterWithCorrectParameter(): void
84+
public function testGetContentCallsBrowserTimingHeaderWithCorrectParameter(): void
8585
{
8686
$this->newRelicWrapperMock->expects($this->once())
8787
->method('isAutoInstrumentEnabled')

0 commit comments

Comments
 (0)