seedLookupData(); $repository = $this->repository(['project_id' => $fixtures['project']->id]); $ticket = $this->ticket([ 'status_id' => $fixtures['open']->id, 'priority_id' => $fixtures['high']->id, 'category_id' => $fixtures['category']->id, 'team_id' => $fixtures['team']->id, 'project_id' => $fixtures['project']->id, ]); GitCommit::query()->create([ 'repository_id' => $repository->id, 'ticket_id' => $ticket->id, 'hash' => str_repeat('a', 40), 'short_hash' => 'aaaaaaa', 'branch' => 'develop', 'author_name' => 'Developer', 'author_email' => 'dev@example.com', 'message' => 'Fix HD reference handling', 'url' => 'https://example.com/commit/a', 'committed_at' => now(), ]); $ticket->refresh()->load(['status', 'priority', 'category', 'team', 'project', 'gitCommits']); self::assertSame('Open', $ticket->status?->name); self::assertSame('High', $ticket->priority?->name); self::assertSame('Support', $ticket->category?->name); self::assertSame('Support Team', $ticket->team?->name); self::assertSame('WMS Core', $ticket->project?->title); self::assertCount(1, $ticket->gitCommits); } public function test_comments_support_nested_replies(): void { $ticket = $this->ticket(); $user = $this->user(); $comment = Comment::query()->create([ 'ticket_id' => $ticket->id, 'user_id' => $user->id, 'body' => '
Parent response
', 'is_internal' => false, ]); Comment::query()->create([ 'ticket_id' => $ticket->id, 'parent_id' => $comment->id, 'user_id' => $user->id, 'body' => 'Nested response
', 'is_internal' => false, ]); self::assertSame('Nested response', strip_tags((string) $comment->replies()->firstOrFail()->body)); self::assertCount(1, $ticket->comments()->with('replies')->get()); } }