summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/Unit/Controllers/Metrics/ControllerTest.php1
-rw-r--r--tests/Unit/Controllers/Metrics/StatsTest.php19
2 files changed, 20 insertions, 0 deletions
diff --git a/tests/Unit/Controllers/Metrics/ControllerTest.php b/tests/Unit/Controllers/Metrics/ControllerTest.php
index f203200c..eefe96ad 100644
--- a/tests/Unit/Controllers/Metrics/ControllerTest.php
+++ b/tests/Unit/Controllers/Metrics/ControllerTest.php
@@ -54,6 +54,7 @@ class ControllerTest extends TestCase
$this->assertArrayHasKey('messages', $data);
$this->assertArrayHasKey('password_resets', $data);
$this->assertArrayHasKey('registration_enabled', $data);
+ $this->assertArrayHasKey('database', $data);
$this->assertArrayHasKey('sessions', $data);
$this->assertArrayHasKey('log_entries', $data);
$this->assertArrayHasKey('scrape_duration_seconds', $data);
diff --git a/tests/Unit/Controllers/Metrics/StatsTest.php b/tests/Unit/Controllers/Metrics/StatsTest.php
index 9ecd4a66..fa78d8c3 100644
--- a/tests/Unit/Controllers/Metrics/StatsTest.php
+++ b/tests/Unit/Controllers/Metrics/StatsTest.php
@@ -109,6 +109,25 @@ class StatsTest extends TestCase
}
/**
+ * @covers \Engelsystem\Controllers\Metrics\Stats::databaseRead
+ * @covers \Engelsystem\Controllers\Metrics\Stats::databaseWrite
+ */
+ public function testDatabase()
+ {
+ $this->initDatabase();
+
+ $stats = new Stats($this->database);
+
+ $read = $stats->databaseRead();
+ $write = $stats->databaseWrite();
+
+ $this->assertIsFloat($read);
+ $this->assertNotEmpty($read);
+ $this->assertIsFloat($write);
+ $this->assertNotEmpty($write);
+ }
+
+ /**
* @covers \Engelsystem\Controllers\Metrics\Stats::logEntries
*/
public function testLogEntries()