|
7 | 7 |
|
8 | 8 | namespace Magento\NewRelicReporting\Test\Unit\ViewModel; |
9 | 9 |
|
10 | | -use Magento\Framework\View\Element\Block\ArgumentInterface; |
11 | 10 | use Magento\NewRelicReporting\Model\NewRelicWrapper; |
12 | 11 | use Magento\NewRelicReporting\ViewModel\BrowserMonitoringFooterJs; |
13 | | -use Magento\NewRelicReporting\ViewModel\ContentProviderInterface; |
14 | 12 | use PHPUnit\Framework\MockObject\Exception; |
15 | 13 | use PHPUnit\Framework\MockObject\MockObject; |
16 | 14 | use PHPUnit\Framework\TestCase; |
@@ -49,8 +47,8 @@ public static function getContentDataProvider(): array |
49 | 47 | { |
50 | 48 | return [ |
51 | 49 | '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>' |
54 | 52 | ], |
55 | 53 | 'enabled_with_null' => [true, null, null], |
56 | 54 | 'enabled_with_empty' => [true, '', ''], |
@@ -96,58 +94,4 @@ public function testGetContentCallsBrowserTimingFooterWithCorrectParameter(): vo |
96 | 94 |
|
97 | 95 | $this->viewModel->getContent(); |
98 | 96 | } |
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 | | - } |
153 | 97 | } |
0 commit comments