Files
fivem-mcp/tests/Feature/GetQBCorePlayersToolTest.php
T
Adrian Mejias b4d3b3582c Add QBCore tools for player and shared data information
- Implement GetQBCorePlayers tool to retrieve player data structure, methods, events, and examples.
- Implement GetQBCoreSharedData tool to retrieve shared data types including items, jobs, gangs, vehicles, weapons, starter items, and utilities.
- Create corresponding Blade views for displaying player and shared data information.
- Add tests for GetQBCoreConfig, GetQBCorePlayers, and GetQBCoreSharedData tools to ensure correct functionality and response handling.
2026-03-01 14:51:22 -06:00

67 lines
2.3 KiB
PHP

<?php
use App\Mcp\Tools\QBCore\GetQBCorePlayers;
use Laravel\Mcp\Request;
test('GetQBCorePlayers returns Structure info', function () {
$tool = new GetQBCorePlayers;
$request = new Request(['info_type' => 'Structure', 'language' => 'lua']);
$response = $tool->handle($request);
expect((string) $response->content())->toContain('Structure');
expect((string) $response->content())->toContain('PlayerData');
expect((string) $response->content())->toContain('Functions');
});
test('GetQBCorePlayers returns PlayerData info', function () {
$tool = new GetQBCorePlayers;
$request = new Request(['info_type' => 'PlayerData', 'language' => 'lua']);
$response = $tool->handle($request);
expect((string) $response->content())->toContain('PlayerData');
expect((string) $response->content())->toContain('citizenid');
expect((string) $response->content())->toContain('charinfo');
});
test('GetQBCorePlayers returns Methods info', function () {
$tool = new GetQBCorePlayers;
$request = new Request(['info_type' => 'Methods', 'language' => 'lua']);
$response = $tool->handle($request);
expect((string) $response->content())->toContain('Methods');
expect((string) $response->content())->toContain('AddItem');
expect((string) $response->content())->toContain('SetJob');
});
test('GetQBCorePlayers returns Events info', function () {
$tool = new GetQBCorePlayers;
$request = new Request(['info_type' => 'Events', 'language' => 'js']);
$response = $tool->handle($request);
expect((string) $response->content())->toContain('Events');
expect((string) $response->content())->toContain('JavaScript Example');
});
test('GetQBCorePlayers returns Examples info', function () {
$tool = new GetQBCorePlayers;
$request = new Request(['info_type' => 'Examples', 'language' => 'lua']);
$response = $tool->handle($request);
expect((string) $response->content())->toContain('Examples');
expect((string) $response->content())->toContain('HasItem');
});
test('GetQBCorePlayers returns not found for invalid type', function () {
$tool = new GetQBCorePlayers;
$request = new Request(['info_type' => 'InvalidType', 'language' => 'lua']);
$response = $tool->handle($request);
expect((string) $response->content())->toContain('not found');
});