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.
This commit is contained in:
25 files changed
+1188
No files matched your search
@@ -0,0 +1,54 @@
|
||||
<?php
|
||||
|
||||
use App\Mcp\Tools\COX\MySQL\GetCOXFunction;
|
||||
use Laravel\Mcp\Request;
|
||||
|
||||
it('get cox function returns response with content', function () {
|
||||
$tool = new GetCOXFunction;
|
||||
$request = new Request(['function_name' => 'MySQL.query']);
|
||||
|
||||
$response = $tool->handle($request);
|
||||
|
||||
expect($response)->not()->toBeNull();
|
||||
expect($response->content())->not()->toBeNull();
|
||||
});
|
||||
|
||||
it('get cox function handles unknown function', function () {
|
||||
$tool = new GetCOXFunction;
|
||||
$request = new Request(['function_name' => 'NonExistentFunction123']);
|
||||
|
||||
$response = $tool->handle($request);
|
||||
$content = (string) $response->content();
|
||||
|
||||
expect($content)->toContain('not found') || expect($content)->toContain('COX');
|
||||
});
|
||||
|
||||
it('get cox function works with insert method', function () {
|
||||
$tool = new GetCOXFunction;
|
||||
$request = new Request(['function_name' => 'MySQL.insert']);
|
||||
|
||||
$response = $tool->handle($request);
|
||||
|
||||
expect($response)->not()->toBeNull();
|
||||
expect($response->content())->not()->toBeNull();
|
||||
});
|
||||
|
||||
it('get cox function supports javascript examples', function () {
|
||||
$tool = new GetCOXFunction;
|
||||
$request = new Request(['function_name' => 'MySQL.query', 'language' => 'js']);
|
||||
|
||||
$response = $tool->handle($request);
|
||||
|
||||
expect($response)->not()->toBeNull();
|
||||
expect($response->content())->not()->toBeNull();
|
||||
});
|
||||
|
||||
it('get cox function works with transaction methods', function () {
|
||||
$tool = new GetCOXFunction;
|
||||
$request = new Request(['function_name' => 'MySQL.transaction']);
|
||||
|
||||
$response = $tool->handle($request);
|
||||
|
||||
expect($response)->not()->toBeNull();
|
||||
expect($response->content())->not()->toBeNull();
|
||||
});
|
||||
Reference in new issue
Block a user