Skip to content

Commit 794d2c5

Browse files
author
klapaudius
committed
#45 Rename "arguments" option to "inputs" in TestMcpPromptCommand and related tests for consistency
1 parent 5bbcb13 commit 794d2c5

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

src/Command/TestMcpPromptCommand.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ protected function configure(): void
101101
->addOption('list', '-l', InputOption::VALUE_NONE, 'List all available prompts')
102102
->setDescription('Test an MCP prompt with simulated inputs')
103103
->setHelp(<<<'EOT'
104-
mcp:test-prompt {prompt? : The name of the prompt to test} {--inputs= : JSON inputs for the prompt} {--list : List all available prompts}
104+
mcp:test-prompt {prompt? : The name of the prompt to test} {--inputs= : JSON input for the prompt} {--list : List all available prompts}
105105
EOT
106106
);
107107
}
@@ -222,7 +222,7 @@ public function displaySchema(PromptInterface $prompt): void
222222
public function getArgumentsFromOption(): ?array
223223
{
224224
// If arguments are provided as an option, use that
225-
$argumentsOption = $this->input->getOption('arguments');
225+
$argumentsOption = $this->input->getOption('inputs');
226226
if ($argumentsOption) {
227227
try {
228228
$decodedArguments = json_decode($argumentsOption, true);
@@ -301,7 +301,7 @@ private function listAllPrompts(): int
301301
$this->io->text([
302302
'To test a specific prompt, run:',
303303
' php bin/console mcp:test-prompt [prompt_name]',
304-
" php bin/console mcp:test-prompt [prompt_name] --arguments='{\"name\":\"value\"}'",
304+
" php bin/console mcp:test-prompt [prompt_name] --inputs='{\"name\":\"value\"}'",
305305
]);
306306

307307
return Command::SUCCESS;

tests/Command/TestMcpPromptCommandTest.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ public function test_get_arguments_from_option_valid_json_returns_array(): void
208208

209209
$this->inputMock
210210
->method('getOption')
211-
->with('arguments')
211+
->with('inputs')
212212
->willReturn($validJson);
213213

214214
$result = $this->command->getArgumentsFromOption();
@@ -229,7 +229,7 @@ public function test_get_arguments_from_option_invalid_json_displays_error(): vo
229229

230230
$this->inputMock
231231
->method('getOption')
232-
->with('arguments')
232+
->with('inputs')
233233
->willReturn($invalidJson);
234234

235235
$this->ioMock
@@ -249,7 +249,7 @@ public function test_get_arguments_from_option_empty_option_returns_null(): void
249249
{
250250
$this->inputMock
251251
->method('getOption')
252-
->with('arguments')
252+
->with('inputs')
253253
->willReturn(null);
254254

255255
$result = $this->command->getArgumentsFromOption();
@@ -411,7 +411,7 @@ public function test_list_all_prompts_displays_table(): void
411411
->with([
412412
'To test a specific prompt, run:',
413413
' php bin/console mcp:test-prompt [prompt_name]',
414-
' php bin/console mcp:test-prompt [prompt_name] --arguments=\'{"name":"value"}\'',
414+
' php bin/console mcp:test-prompt [prompt_name] --inputs=\'{"name":"value"}\'',
415415
]);
416416

417417
$result = $this->command->execute($this->inputMock, $this->outputMock);
@@ -734,9 +734,9 @@ public function test_test_prompt_execution_failure(): void
734734
// Second call from displaySchema (no arguments)
735735
return $text === 'This prompt accepts no arguments.';
736736
} elseif ($textCallCount === 3) {
737-
// Third call - executing prompt with arguments
737+
// Third call - executing prompt with inputs
738738
return is_array($text) &&
739-
$text[0] === 'Executing prompt with arguments:' &&
739+
$text[0] === 'Executing prompt with inputs:' &&
740740
$text[1] === '[]';
741741
} elseif ($textCallCount === 4) {
742742
// Fourth call from error stack trace
@@ -783,7 +783,7 @@ public function test_test_prompt_with_invalid_arguments_from_option(): void
783783
$this->inputMock->method('getArgument')->with('prompt')->willReturn('test-prompt');
784784
$this->inputMock->method('getOption')->willReturnMap([
785785
['list', false], // First call is for --list
786-
['arguments', 'invalid-json'], // Second call is for --arguments
786+
['inputs', 'invalid-json'], // Second call is for --inputs
787787
]);
788788

789789
$promptMock = $this->createMock(PromptInterface::class);

0 commit comments

Comments
 (0)