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:
17
tests/Fakes/FakeArticleRepository.php
Normal file
17
tests/Fakes/FakeArticleRepository.php
Normal file
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
namespace Tests\Fakes;
|
||||
|
||||
use App\DTOs\ArticleCandidateDTO;
|
||||
use App\Repositories\Contracts\ArticleRepositoryInterface;
|
||||
|
||||
class FakeArticleRepository implements ArticleRepositoryInterface
|
||||
{
|
||||
/** @var array<int, ArticleCandidateDTO> */
|
||||
public array $candidates = [];
|
||||
|
||||
public function findSimilarByEmbedding(array $embedding, int $limit = 5, array $embeddingContext = []): array
|
||||
{
|
||||
return array_slice($this->candidates, 0, $limit);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user