create(); $teamMember = TeamMember::factory()->create(['role_id' => $role->id]); $project = Project::factory()->create(); Allocation::factory()->create([ 'project_id' => $project->id, 'team_member_id' => $teamMember->id, 'month' => '2026-02-01', 'allocated_hours' => 40, ]); $matrixService = new AllocationMatrixService(new VarianceCalculator); $result = $matrixService->getMatrix('2026-02'); $this->assertArrayHasKey('allocations', $result); $this->assertArrayHasKey('projectTotals', $result); $this->assertArrayHasKey('teamMemberTotals', $result); $this->assertArrayHasKey('grandTotal', $result); } }