- Implemented GetOxDoorlockServerFunction and GetOxDoorlockClientFunction for server-side and client-side door management, respectively. - Created GetOxFuelServerFunction and GetOxFuelClientFunction for handling fuel management on server and client sides. - Developed GetOxTargetClientFunction to manage targeting interactions, including global options and zone management. - Added feature tests for all new tools to ensure functionality and error handling for unknown functions.
35 lines
1.1 KiB
PHP
35 lines
1.1 KiB
PHP
<?php
|
|
|
|
use App\Mcp\Tools\COX\Fuel\Client\GetOxFuelClientFunction;
|
|
use Laravel\Mcp\Request;
|
|
|
|
it('get ox_fuel client function returns response with content', function () {
|
|
$tool = new GetOxFuelClientFunction;
|
|
$request = new Request(['function_name' => 'setMoneyCheck']);
|
|
|
|
$response = $tool->handle($request);
|
|
|
|
expect($response)->not()->toBeNull();
|
|
expect($response->content())->not()->toBeNull();
|
|
});
|
|
|
|
it('get ox_fuel client function handles unknown function', function () {
|
|
$tool = new GetOxFuelClientFunction;
|
|
$request = new Request(['function_name' => 'NonExistentFunction123']);
|
|
|
|
$response = $tool->handle($request);
|
|
$content = (string) $response->content();
|
|
|
|
expect($content)->toContain('not found');
|
|
});
|
|
|
|
it('get ox_fuel client function supports javascript examples', function () {
|
|
$tool = new GetOxFuelClientFunction;
|
|
$request = new Request(['function_name' => 'setMoneyCheck', 'language' => 'js']);
|
|
|
|
$response = $tool->handle($request);
|
|
|
|
expect($response)->not()->toBeNull();
|
|
expect($response->content())->not()->toBeNull();
|
|
});
|