| Conditions | 1 |
| Paths | 1 |
| Total Lines | 15 |
| Code Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 15 | public function testRender() |
||
| 16 | { |
||
| 17 | $collectionRegistry = $this->createMock(CollectorRegistry::class); |
||
| 18 | $collectionRegistry->expects(self::once())->method('getMetricFamilySamples')->willReturn([new MetricFamilySamples([ |
||
| 19 | 'name' => 'name', |
||
| 20 | 'type' => 'type', |
||
| 21 | 'help' => 'help', |
||
| 22 | 'labelNames' => [], |
||
| 23 | 'samples' => [], |
||
| 24 | ])]); |
||
| 25 | $metrics = new AppMetrics(); |
||
| 26 | $metrics->init('test_ns', $collectionRegistry); |
||
| 27 | $renderer = new Renderer($collectionRegistry); |
||
| 28 | $response = $renderer->render(); |
||
| 29 | $this->assertEquals("# HELP name help\n# TYPE name type\n", $response); |
||
| 30 | } |
||
| 49 |