Add unit and feature tests for ticket processing and article management
- 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.
This commit is contained in:
22
tests/Fakes/FakeTicketProcessingLoggerService.php
Normal file
22
tests/Fakes/FakeTicketProcessingLoggerService.php
Normal file
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
namespace Tests\Fakes;
|
||||
|
||||
use App\Models\Ticket;
|
||||
use App\Services\TicketProcessingLoggerService;
|
||||
|
||||
class FakeTicketProcessingLoggerService extends TicketProcessingLoggerService
|
||||
{
|
||||
/** @var array<int, array{step:string,status:string,message:string|null,context:array}> */
|
||||
public array $logs = [];
|
||||
|
||||
public function log(Ticket $ticket, string $step, string $status = 'info', ?string $message = null, array $context = []): void
|
||||
{
|
||||
$this->logs[] = [
|
||||
'step' => $step,
|
||||
'status' => $status,
|
||||
'message' => $message,
|
||||
'context' => $context,
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user