appManager = $this->createMock(IAppManager::class); $this->appManager->method('getAppInstalledVersions') ->with(false) ->willReturn(['app1', 'app2', 'app3', 'app4', 'app5']); $this->appManager->method('getEnabledApps') ->willReturn(['app1', 'app2', 'app3']); return new AppsCount($this->appManager); } public function testMetrics(): void { foreach ($this->metrics as $metric) { $expectedValue = match ($metric->label('status')) { 'disabled' => 2, 'enabled' => 3, }; $this->assertEquals($expectedValue, $metric->value); } } }