Files
fivem-mcp/tests/Feature/QBCore/GetQBCoreClientEventReferenceToolTest.php
T
Adrian Mejias 29b854fd44 Add feature tests for QBCore and FiveM tools
- Implement tests for GetInventoryClientFunction and GetInventoryServerFunction in the COX namespace.
- Create tests for GenerateManifest and GenerateResourceBoilerplate in the FiveM namespace.
- Add tests for event and native function references in the FiveM namespace.
- Introduce tests for QBCore client and server event references, functions, and configurations.
- Implement tests for shared data retrieval in QBCore.
- Ensure all tests validate expected responses and handle edge cases.
2026-03-01 15:23:07 -06:00

50 lines
1.5 KiB
PHP

<?php
use App\Mcp\Tools\QBCore\Client\GetQBCoreClientEventReference;
use Laravel\Mcp\Request;
it('returns qbcore client event reference', function () {
$tool = new GetQBCoreClientEventReference;
$request = new Request(['event_name' => 'QBCore:Client:OnPlayerLoad']);
$response = $tool->handle($request);
expect((string) $response->content())->toContain('OnPlayerLoad');
});
it('returns not found for invalid client event', function () {
$tool = new GetQBCoreClientEventReference;
$request = new Request(['event_name' => 'InvalidClientEvent']);
$response = $tool->handle($request);
expect((string) $response->content())->toContain('not found');
});
it('lists all client events when empty event name', function () {
$tool = new GetQBCoreClientEventReference;
$request = new Request(['event_name' => '']);
$response = $tool->handle($request);
expect((string) $response->content())->not()->toBeEmpty();
});
it('searches by client event short names', function () {
$tool = new GetQBCoreClientEventReference;
$request = new Request(['event_name' => 'QBCore:Client:OnPlayerLoad']);
$response = $tool->handle($request);
expect((string) $response->content())->toContain('OnPlayerLoad');
});
it('includes notification event', function () {
$tool = new GetQBCoreClientEventReference;
$request = new Request(['event_name' => 'QBCore:Notify']);
$response = $tool->handle($request);
expect((string) $response->content())->toContain('Notify');
});