- Implement Fake repositories and services for testing purposes. - Create tests for Article API including creation, validation, and listing. - Develop ProcessTicketJobFlowTest to validate ticket processing logic. - Add QuickReplyAdminTest for creating and updating quick replies. - Implement TicketAndArticleModelTest to ensure proper cascading deletes and credential encryption. - Create TicketIngestionTest for ticket creation and job dispatching. - Add TicketShowPageTest to verify rendering of quick replies and tool calls. - Implement unit tests for ClassifierPromptBuilder, EmbeddingService, LlmJsonDecoder, QuickReplyResolver, SupportReplyService, TicketResultPayloadBuilder, TicketToolCallService, and ToolCallRequestValidator.
30 lines
676 B
PHP
30 lines
676 B
PHP
<?php
|
|
|
|
namespace Tests\Fakes;
|
|
|
|
use App\Services\Tools\DomainInfoTool;
|
|
use App\Services\Tools\OxxaClient;
|
|
|
|
class FakeDomainInfoTool extends DomainInfoTool
|
|
{
|
|
/** @var array<int, array{parameters:array,credentials:array}> */
|
|
public array $calls = [];
|
|
|
|
public array $response = ['ok' => true, 'data' => ['domain' => 'example.nl']];
|
|
|
|
public function __construct()
|
|
{
|
|
parent::__construct(new OxxaClient);
|
|
}
|
|
|
|
public function execute(array $parameters, array $credentials): array
|
|
{
|
|
$this->calls[] = [
|
|
'parameters' => $parameters,
|
|
'credentials' => $credentials,
|
|
];
|
|
|
|
return $this->response;
|
|
}
|
|
}
|