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,34 @@
|
||||
<?php
|
||||
|
||||
use App\Mcp\Tools\GetQBCoreEventReference;
|
||||
use Laravel\Mcp\Request;
|
||||
|
||||
it('get qbcore event reference returns response with content', function () {
|
||||
$tool = new GetQBCoreEventReference();
|
||||
$request = new Request(['event_name' => 'QBCore:Client:OnPlayerLoaded']);
|
||||
|
||||
$response = $tool->handle($request);
|
||||
|
||||
expect($response)->not()->toBeNull();
|
||||
expect($response->content())->not()->toBeNull();
|
||||
});
|
||||
|
||||
it('get qbcore event reference handles unknown event', function () {
|
||||
$tool = new GetQBCoreEventReference();
|
||||
$request = new Request(['event_name' => 'NonExistentQBCoreEvent123']);
|
||||
|
||||
$response = $tool->handle($request);
|
||||
$content = (string) $response->content();
|
||||
|
||||
expect($content)->toContain('not found') || expect($content)->toContain('QBCore event');
|
||||
});
|
||||
|
||||
it('get qbcore event reference filters by category', function () {
|
||||
$tool = new GetQBCoreEventReference();
|
||||
$request = new Request(['event_category' => 'player']);
|
||||
|
||||
$response = $tool->handle($request);
|
||||
|
||||
expect($response)->not()->toBeNull();
|
||||
expect($response->content())->not()->toBeNull();
|
||||
});
|
||||
Reference in new issue
Block a user