Files
fivem-mcp/tests/Feature/COX/GetOxDoorlockClientFunctionToolTest.php
T
Adrian Mejias 24c53368a7 Add COX tools for doorlock, fuel, and target functionalities
- 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.
2026-03-01 15:35:04 -06:00

55 lines
1.8 KiB
PHP

<?php
use App\Mcp\Tools\COX\Doorlock\Client\GetOxDoorlockClientFunction;
use Laravel\Mcp\Request;
it('get ox_doorlock client function returns response with content', function () {
$tool = new GetOxDoorlockClientFunction;
$request = new Request(['function_name' => 'getClosestDoor']);
$response = $tool->handle($request);
expect($response)->not()->toBeNull();
expect($response->content())->not()->toBeNull();
});
it('get ox_doorlock client function handles unknown function', function () {
$tool = new GetOxDoorlockClientFunction;
$request = new Request(['function_name' => 'NonExistentFunction123']);
$response = $tool->handle($request);
$content = (string) $response->content();
expect($content)->toContain('not found');
});
it('get ox_doorlock client function works with pickClosestDoor', function () {
$tool = new GetOxDoorlockClientFunction;
$request = new Request(['function_name' => 'pickClosestDoor']);
$response = $tool->handle($request);
expect($response)->not()->toBeNull();
expect($response->content())->not()->toBeNull();
});
it('get ox_doorlock client function works with useClosestDoor', function () {
$tool = new GetOxDoorlockClientFunction;
$request = new Request(['function_name' => 'useClosestDoor']);
$response = $tool->handle($request);
expect($response)->not()->toBeNull();
expect($response->content())->not()->toBeNull();
});
it('get ox_doorlock client function supports javascript examples', function () {
$tool = new GetOxDoorlockClientFunction;
$request = new Request(['function_name' => 'getClosestDoor', 'language' => 'js']);
$response = $tool->handle($request);
expect($response)->not()->toBeNull();
expect($response->content())->not()->toBeNull();
});