Conditions | 1 |
Paths | 1 |
Total Lines | 15 |
Code Lines | 12 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
32 | public function testRenderResponse() |
||
33 | { |
||
34 | $collectionRegistry = $this->createMock(CollectorRegistry::class); |
||
35 | $collectionRegistry->expects(self::once())->method('getMetricFamilySamples')->willReturn([new MetricFamilySamples([ |
||
36 | 'name' => 'name', |
||
37 | 'type' => 'type', |
||
38 | 'help' => 'help', |
||
39 | 'labelNames' => [], |
||
40 | 'samples' => [], |
||
41 | ])]); |
||
42 | $metrics = new AppMetrics(); |
||
43 | $metrics->init('test_ns', $collectionRegistry); |
||
44 | $renderer = new Renderer($collectionRegistry); |
||
45 | $response = $renderer->renderResponse(); |
||
46 | $this->assertContains("# HELP name help\n# TYPE name type\n", $response->getContent()); |
||
47 | } |
||
49 |