Skip to content

Commit 0e69ab1

Browse files
committed
API: Added test to cover system info endpoint
1 parent 0580071 commit 0e69ab1

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

tests/Api/SystemApiTest.php

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<?php
2+
3+
namespace Api;
4+
5+
use BookStack\Activity\ActivityType;
6+
use BookStack\Facades\Activity;
7+
use Tests\Api\TestsApi;
8+
use Tests\TestCase;
9+
10+
class SystemApiTest extends TestCase
11+
{
12+
use TestsApi;
13+
14+
public function test_read_returns_app_info(): void
15+
{
16+
$resp = $this->actingAsApiEditor()->get('/api/system');
17+
$data = $resp->json();
18+
19+
$this->assertStringStartsWith('v', $data['version']);
20+
$this->assertEquals(setting('instance-id'), $data['instance_id']);
21+
$this->assertEquals(setting('app-name'), $data['app_name']);
22+
$this->assertEquals(url('/logo.png'), $data['app_logo']);
23+
$this->assertEquals(url('/'), $data['base_url']);
24+
}
25+
}

0 commit comments

Comments
 (0)