]> BookStack Code Mirror - bookstack/commitdiff
API: Added test to cover system info endpoint 5607/head
authorDan Brown <redacted>
Tue, 13 May 2025 19:46:11 +0000 (20:46 +0100)
committerDan Brown <redacted>
Tue, 13 May 2025 19:46:11 +0000 (20:46 +0100)
tests/Api/SystemApiTest.php [new file with mode: 0644]

diff --git a/tests/Api/SystemApiTest.php b/tests/Api/SystemApiTest.php
new file mode 100644 (file)
index 0000000..21e378d
--- /dev/null
@@ -0,0 +1,25 @@
+<?php
+
+namespace Api;
+
+use BookStack\Activity\ActivityType;
+use BookStack\Facades\Activity;
+use Tests\Api\TestsApi;
+use Tests\TestCase;
+
+class SystemApiTest extends TestCase
+{
+    use TestsApi;
+
+    public function test_read_returns_app_info(): void
+    {
+        $resp = $this->actingAsApiEditor()->get('/api/system');
+        $data = $resp->json();
+
+        $this->assertStringStartsWith('v', $data['version']);
+        $this->assertEquals(setting('instance-id'), $data['instance_id']);
+        $this->assertEquals(setting('app-name'), $data['app_name']);
+        $this->assertEquals(url('/logo.png'), $data['app_logo']);
+        $this->assertEquals(url('/'), $data['base_url']);
+    }
+}
Morty Proxy This is a proxified and sanitized view of the page, visit original site.