Files
fivem-mcp/tests/Feature/GetInventoryClientFunctionToolTest.php
T
Adrian Mejias 4a4d9822e7 Add documentation links, refactor tools, and implement new tests
- Added links to QBCore and COX MySQL documentation in the main docs index.
- Refactored GenerateManifest and GenerateResourceBoilerplate tools to use the correct namespaces.
- Updated tests for GenerateManifest and GenerateResourceBoilerplate tools to remove unnecessary parentheses.
- Refactored COX event and function tools to use the correct namespaces and updated related tests.
- Introduced new tests for GetEventClientReference and GetEventServerReference tools.
- Added tests for inventory client and server functions, ensuring they handle various scenarios.
- Created tests for native client and server functions, including case insensitivity and example support.
- Implemented QBCore client and server event/function reference tests, ensuring proper functionality and error handling.
- Removed outdated tests for GetEventReference and GetQBCoreEventReference tools.
- Updated SearchFiveMDocs tool to use the correct namespace and improved test coverage.
2026-03-01 14:30:24 -06:00

65 lines
2.0 KiB
PHP

<?php
use App\Mcp\Tools\COX\Inventory\Client\GetInventoryClientFunction;
use Laravel\Mcp\Request;
it('get inventory client function returns response with content', function () {
$tool = new GetInventoryClientFunction;
$request = new Request(['function_name' => 'openInventory']);
$response = $tool->handle($request);
expect($response)->not()->toBeNull();
expect($response->content())->not()->toBeNull();
});
it('get inventory client function handles unknown function', function () {
$tool = new GetInventoryClientFunction;
$request = new Request(['function_name' => 'NonExistentFunction123']);
$response = $tool->handle($request);
$content = (string) $response->content();
expect($content)->toContain('not found');
});
it('get inventory client function works with SearchPlayer', function () {
$tool = new GetInventoryClientFunction;
$request = new Request(['function_name' => 'SearchPlayer']);
$response = $tool->handle($request);
expect($response)->not()->toBeNull();
expect($response->content())->not()->toBeNull();
});
it('get inventory client function works with useItem', function () {
$tool = new GetInventoryClientFunction;
$request = new Request(['function_name' => 'useItem']);
$response = $tool->handle($request);
expect($response)->not()->toBeNull();
expect($response->content())->not()->toBeNull();
});
it('get inventory client function supports javascript examples', function () {
$tool = new GetInventoryClientFunction;
$request = new Request(['function_name' => 'GetCurrentWeapon', 'language' => 'js']);
$response = $tool->handle($request);
expect($response)->not()->toBeNull();
expect($response->content())->not()->toBeNull();
});
it('get inventory client function works with getCurrentWeight', function () {
$tool = new GetInventoryClientFunction;
$request = new Request(['function_name' => 'getCurrentWeight']);
$response = $tool->handle($request);
expect($response)->not()->toBeNull();
expect($response->content())->not()->toBeNull();
});