- 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.
55 lines
1.6 KiB
PHP
55 lines
1.6 KiB
PHP
<?php
|
|
|
|
use App\Mcp\Tools\COX\MySQL\GetCOXEventReference;
|
|
use Laravel\Mcp\Request;
|
|
|
|
it('get cox event reference returns response with content', function () {
|
|
$tool = new GetCOXEventReference;
|
|
$request = new Request(['event_name' => 'coxMySQL:connected']);
|
|
|
|
$response = $tool->handle($request);
|
|
|
|
expect($response)->not()->toBeNull();
|
|
expect($response->content())->not()->toBeNull();
|
|
});
|
|
|
|
it('get cox event reference handles unknown event', function () {
|
|
$tool = new GetCOXEventReference;
|
|
$request = new Request(['event_name' => 'NonExistentCOXEvent123']);
|
|
|
|
$response = $tool->handle($request);
|
|
$content = (string) $response->content();
|
|
|
|
expect($content)->toContain('not found') || expect($content)->toContain('COX event');
|
|
});
|
|
|
|
it('get cox event reference filters by type', function () {
|
|
$tool = new GetCOXEventReference;
|
|
$request = new Request(['event_type' => 'connection']);
|
|
|
|
$response = $tool->handle($request);
|
|
|
|
expect($response)->not()->toBeNull();
|
|
expect($response->content())->not()->toBeNull();
|
|
});
|
|
|
|
it('get cox event reference lists all events', function () {
|
|
$tool = new GetCOXEventReference;
|
|
$request = new Request(['event_type' => 'all']);
|
|
|
|
$response = $tool->handle($request);
|
|
|
|
expect($response)->not()->toBeNull();
|
|
expect($response->content())->not()->toBeNull();
|
|
});
|
|
|
|
it('get cox event reference supports query events', function () {
|
|
$tool = new GetCOXEventReference;
|
|
$request = new Request(['event_name' => 'coxMySQL:queryCompleted']);
|
|
|
|
$response = $tool->handle($request);
|
|
|
|
expect($response)->not()->toBeNull();
|
|
expect($response->content())->not()->toBeNull();
|
|
});
|