assertInstanceOf(ShouldBroadcast::class, $event); } public function test_broadcasts_on_private_submission_channel(): void { $event = new FormSubmissionIdentityMatchResolved('01HX1234567890', 'matched', 2); $channels = $event->broadcastOn(); $this->assertCount(1, $channels); $this->assertInstanceOf(PrivateChannel::class, $channels[0]); // PrivateChannel prepends 'private-' to the name passed to its // constructor; that's the wire-format the frontend Echo client // subscribes to. $this->assertSame('private-submission.01HX1234567890', $channels[0]->name); } public function test_broadcast_as(): void { $event = new FormSubmissionIdentityMatchResolved('01HX', 'matched', 1); $this->assertSame('identity-match.resolved', $event->broadcastAs()); } public function test_constructor_assigns_payload_readonly(): void { $event = new FormSubmissionIdentityMatchResolved('01HX', 'no_match', 0); $this->assertSame('01HX', $event->submissionId); $this->assertSame('no_match', $event->status); $this->assertSame(0, $event->matchCount); } }