|
@@ 38-51 (lines=14) @@
|
| 35 |
|
$this->metricsProvider->addMetricsProvider($provider, [$collector]); |
| 36 |
|
} |
| 37 |
|
|
| 38 |
|
public function testCollectMetrics() |
| 39 |
|
{ |
| 40 |
|
$collector = $this->createMock(Collector::class); |
| 41 |
|
$provider = $this->createMock(ProviderInterface::class); |
| 42 |
|
$collectorCollection = $this->getCollectorCollection($collector); |
| 43 |
|
|
| 44 |
|
$provider |
| 45 |
|
->expects($this->once()) |
| 46 |
|
->method('collectMetrics') |
| 47 |
|
->with($collectorCollection); |
| 48 |
|
|
| 49 |
|
$this->metricsProvider->addMetricsProvider($provider, [$collector]); |
| 50 |
|
$this->metricsProvider->collectMetrics(); |
| 51 |
|
} |
| 52 |
|
|
| 53 |
|
public function testOnTerminate() |
| 54 |
|
{ |
|
@@ 53-66 (lines=14) @@
|
| 50 |
|
$this->metricsProvider->collectMetrics(); |
| 51 |
|
} |
| 52 |
|
|
| 53 |
|
public function testOnTerminate() |
| 54 |
|
{ |
| 55 |
|
$collector = $this->createMock(Collector::class); |
| 56 |
|
$provider = $this->createMock(ProviderInterface::class); |
| 57 |
|
$collectorCollection = $this->getCollectorCollection($collector); |
| 58 |
|
|
| 59 |
|
$provider |
| 60 |
|
->expects($this->once()) |
| 61 |
|
->method('collectMetrics') |
| 62 |
|
->with($collectorCollection); |
| 63 |
|
|
| 64 |
|
$this->metricsProvider->addMetricsProvider($provider, [$collector]); |
| 65 |
|
$this->metricsProvider->collectMetrics(); |
| 66 |
|
} |
| 67 |
|
|
| 68 |
|
private function getCollectorCollection($collector) |
| 69 |
|
{ |