Skip to content

Commit 7030b35

Browse files
committed
Refactor
2 parents 21117a5 + 1c7878b commit 7030b35

File tree

2 files changed

+28
-8
lines changed

2 files changed

+28
-8
lines changed

composer.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,14 @@
2121
"php": "^8.1",
2222
"ext-json": "*",
2323
"ext-mbstring": "*",
24-
"illuminate/container": "^10.49.0|^11.45.3|^12.28.1",
25-
"illuminate/console": "^10.49.0|^11.45.3|^12.28.1",
26-
"illuminate/contracts": "^10.49.0|^11.45.3|^12.28.1",
27-
"illuminate/http": "^10.49.0|^11.45.3|^12.28.1",
28-
"illuminate/routing": "^10.49.0|^11.45.3|^12.28.1",
29-
"illuminate/support": "^10.49.0|^11.45.3|^12.28.1",
30-
"illuminate/validation": "^10.49.0|^11.45.3|^12.28.1",
31-
"illuminate/json-schema": "^12.28.1"
24+
"illuminate/container": "^10.49.0|^11.45.3|^12.41.1",
25+
"illuminate/console": "^10.49.0|^11.45.3|^12.41.1",
26+
"illuminate/contracts": "^10.49.0|^11.45.3|^12.41.1",
27+
"illuminate/http": "^10.49.0|^11.45.3|^12.41.1",
28+
"illuminate/routing": "^10.49.0|^11.45.3|^12.41.1",
29+
"illuminate/support": "^10.49.0|^11.45.3|^12.41.1",
30+
"illuminate/validation": "^10.49.0|^11.45.3|^12.41.1",
31+
"illuminate/json-schema": "^12.41.1"
3232
},
3333
"require-dev": {
3434
"laravel/pint": "^1.20",
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<?php
2+
3+
use Laravel\Mcp\Server\Completions\ArrayCompletionResponse;
4+
use Laravel\Mcp\Server\Completions\DirectCompletionResponse;
5+
6+
it('filters by prefix when resolved', function (): void {
7+
$result = new ArrayCompletionResponse(['php', 'python', 'javascript', 'go']);
8+
9+
$resolved = $result->resolve('py');
10+
11+
expect($resolved)->toBeInstanceOf(DirectCompletionResponse::class)
12+
->and($resolved->values())->toBe(['python']);
13+
});
14+
15+
it('starts with empty values until resolved', function (): void {
16+
$result = new ArrayCompletionResponse(['php', 'python', 'javascript']);
17+
18+
expect($result->values())->toBe([])
19+
->and($result->hasMore())->toBeFalse();
20+
});

0 commit comments

Comments
 (0)