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.
This commit is contained in:
38 files changed
+2248
-818
No files matched your search
@@ -0,0 +1,49 @@
|
||||
<?php
|
||||
|
||||
use App\Mcp\Tools\FiveM\Client\GetNativeClientFunction;
|
||||
use Laravel\Mcp\Request;
|
||||
|
||||
it('returns client native function info', function () {
|
||||
$tool = new GetNativeClientFunction;
|
||||
$request = new Request(['function_name' => 'PlayerPedId', 'language' => 'lua']);
|
||||
|
||||
$response = $tool->handle($request);
|
||||
|
||||
expect((string) $response->content())->toContain('PlayerPedId');
|
||||
});
|
||||
|
||||
it('returns not found for invalid function', function () {
|
||||
$tool = new GetNativeClientFunction;
|
||||
$request = new Request(['function_name' => 'InvalidFunction', 'language' => 'lua']);
|
||||
|
||||
$response = $tool->handle($request);
|
||||
|
||||
expect((string) $response->content())->toContain('not found');
|
||||
});
|
||||
|
||||
it('supports javascript examples', function () {
|
||||
$tool = new GetNativeClientFunction;
|
||||
$request = new Request(['function_name' => 'GetEntityCoords', 'language' => 'js']);
|
||||
|
||||
$response = $tool->handle($request);
|
||||
|
||||
expect((string) $response->content())->toContain('js');
|
||||
});
|
||||
|
||||
it('handles case insensitive function names', function () {
|
||||
$tool = new GetNativeClientFunction;
|
||||
$request = new Request(['function_name' => 'playerpedid', 'language' => 'lua']);
|
||||
|
||||
$response = $tool->handle($request);
|
||||
|
||||
expect((string) $response->content())->toContain('PlayerPedId');
|
||||
});
|
||||
|
||||
it('lists all client functions when no name provided', function () {
|
||||
$tool = new GetNativeClientFunction;
|
||||
$request = new Request(['function_name' => '', 'language' => 'lua']);
|
||||
|
||||
$response = $tool->handle($request);
|
||||
|
||||
expect((string) $response->content())->not()->toBeEmpty();
|
||||
});
|
||||
Reference in new issue
Block a user