Skip to content

Commit 008220f

Browse files
committed
refactor: cover with unit tests Resource reader, Prompt getter and Tool executor
1 parent 3915e6f commit 008220f

File tree

12 files changed

+2339
-103
lines changed

12 files changed

+2339
-103
lines changed

.guideline/tests.md

Lines changed: 513 additions & 0 deletions
Large diffs are not rendered by default.

src/Capability/DispatchableRegistry.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@ public function registerPrompt(
7171
bool $isManual = false,
7272
): void {
7373
$this->referenceProvider->registerPrompt($prompt, $handler, $completionProviders, $isManual);
74-
7574
$this->eventDispatcher?->dispatch(new PromptListChangedEvent());
7675
}
7776

src/Capability/Prompt/DefaultPromptGetter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public function get(GetPromptRequest $request): GetPromptResult
4242

4343
return new GetPromptResult(
4444
$reference->formatResult(
45-
$this->referenceHandler->handle($reference, $request->arguments),
45+
$this->referenceHandler->handle($reference, $request->arguments ?? []),
4646
),
4747
);
4848
}

src/Capability/Registry/ResourceTemplateReference.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ private function compileTemplate(): void
162162
* - array: Converted to JSON if MIME type is application/json or contains 'json'
163163
* For other MIME types, will try to convert to JSON with a warning
164164
*/
165-
protected function formatResult(mixed $readResult, string $uri, ?string $mimeType = null): array
165+
public function formatResult(mixed $readResult, string $uri, ?string $mimeType = null): array
166166
{
167167
if ($readResult instanceof ResourceContents) {
168168
return [$readResult];

src/Capability/Resource/ResourceReadResult.php

Lines changed: 0 additions & 30 deletions
This file was deleted.

0 commit comments

Comments
 (0)