-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathMcpServerTest.php
More file actions
72 lines (55 loc) · 2.02 KB
/
Copy pathMcpServerTest.php
File metadata and controls
72 lines (55 loc) · 2.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
<?php
use App\Mcp\Servers\FairmdLipidsServer;
use App\Mcp\Tools\AdvancedTrajectorySearchTool;
use App\Mcp\Tools\BestSimulationsTool;
use App\Mcp\Tools\DatabaseStatisticsTool;
use App\Mcp\Tools\GetLipidTool;
use App\Mcp\Tools\GetTrajectoryTool;
use App\Mcp\Tools\SearchDatabaseTool;
test('search-database finds POPC lipids', function () {
$response = FairmdLipidsServer::tool(SearchDatabaseTool::class, [
'text' => 'POPC',
]);
$response->assertOk()->assertSee('POPC');
});
test('search-database requires text', function () {
$response = FairmdLipidsServer::tool(SearchDatabaseTool::class, []);
$response->assertHasErrors();
});
test('best-simulations ranks POPC simulations best-first', function () {
$response = FairmdLipidsServer::tool(BestSimulationsTool::class, [
'lipid' => 'POPC',
'limit' => 5,
]);
$response->assertOk()->assertSee('rank-product');
});
test('get-trajectory returns detail for a known trajectory', function () {
$response = FairmdLipidsServer::tool(GetTrajectoryTool::class, [
'id' => 805,
]);
$response->assertOk()->assertSee('805');
});
test('get-trajectory errors for a missing trajectory', function () {
$response = FairmdLipidsServer::tool(GetTrajectoryTool::class, [
'id' => 999999,
]);
$response->assertHasErrors();
});
test('get-lipid returns detail for POPC', function () {
$response = FairmdLipidsServer::tool(GetLipidTool::class, [
'id_or_molecule' => 'POPC',
]);
$response->assertOk()->assertSee('POPC');
});
test('advanced-trajectory-search filters by lipid', function () {
$response = FairmdLipidsServer::tool(AdvancedTrajectorySearchTool::class, [
'lipids' => ['POPC'],
'lipids_operator' => ['and'],
'per_page' => 5,
]);
$response->assertOk()->assertSee('total');
});
test('database-statistics returns totals', function () {
$response = FairmdLipidsServer::tool(DatabaseStatisticsTool::class, []);
$response->assertOk()->assertSee('total_trajectories');
});