Add QBCore event and function tools with documentation and tests
- Implement GetQBCoreEventReference tool to retrieve QBCore event information. - Implement GetQBCoreFunction tool to look up QBCore functions and exports. - Enhance SearchFiveMDocs to include QBCore documentation links. - Create Blade views for displaying QBCore events and function details. - Add tests for GetQBCoreEventReference and GetQBCoreFunction tools to ensure functionality and error handling.
This commit is contained in:
8 files changed
+769
-1
No files matched your search
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
|
||||
use App\Mcp\Tools\GetQBCoreFunction;
|
||||
use Laravel\Mcp\Request;
|
||||
|
||||
it('get qbcore function returns response with content', function () {
|
||||
$tool = new GetQBCoreFunction();
|
||||
$request = new Request(['function_name' => 'QBCore.Functions.GetPlayer']);
|
||||
|
||||
$response = $tool->handle($request);
|
||||
|
||||
expect($response)->not()->toBeNull();
|
||||
expect($response->content())->not()->toBeNull();
|
||||
});
|
||||
|
||||
it('get qbcore function handles unknown function', function () {
|
||||
$tool = new GetQBCoreFunction();
|
||||
$request = new Request(['function_name' => 'NonExistentFunction123']);
|
||||
|
||||
$response = $tool->handle($request);
|
||||
$content = (string) $response->content();
|
||||
|
||||
expect($content)->toContain('not found') || expect($content)->toContain('QBCore');
|
||||
});
|
||||
|
||||
it('get qbcore function works with shorthand names', function () {
|
||||
$tool = new GetQBCoreFunction();
|
||||
$request = new Request(['function_name' => 'AddMoney']);
|
||||
|
||||
$response = $tool->handle($request);
|
||||
|
||||
expect($response)->not()->toBeNull();
|
||||
expect($response->content())->not()->toBeNull();
|
||||
});
|
||||
|
||||
it('get qbcore function supports javascript examples', function () {
|
||||
$tool = new GetQBCoreFunction();
|
||||
$request = new Request(['function_name' => 'AddMoney', 'language' => 'js']);
|
||||
|
||||
$response = $tool->handle($request);
|
||||
|
||||
expect($response)->not()->toBeNull();
|
||||
expect($response->content())->not()->toBeNull();
|
||||
});
|
||||
Reference in new issue
Block a user