fix(form-builder): post-WS-6 trim of TriggerPersonIdentityMatch dead path (WS-6)

Per RFC Q2: the 'no subject → pending' path becomes unreachable for
event_registration submissions because ApplyBindingsOnFormSubmit
provisions the Person before this listener fires. Path preserved as
failsafe with explicit warning log so misconfigurations and silent
ApplyBindings failures surface mechanically.

Existing test updated to spy on Log facade and assert the warning fires.

Refs: RFC-WS-6.md §3 (Q2)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-26 13:27:54 +02:00
parent 6b5111ce43
commit acfa90ff50
2 changed files with 29 additions and 3 deletions

View File

@@ -84,9 +84,23 @@ final class TriggerPersonIdentityMatchOnFormSubmitTest extends TestCase
public function test_public_event_registration_submission_is_marked_pending(): void
{
// RFC Q2: this path is now a logged-warning failsafe. The pending
// state is preserved for portal banner rendering, but a misconfigured
// schema or silently-failed ApplyBindings should surface in logs.
// Spy mode (not strict mock) so other listeners' Log calls don't
// interfere — ApplyBindingsOnFormSubmit may also log error here.
$logSpy = \Illuminate\Support\Facades\Log::spy();
$submission = $this->submit();
$this->assertSame('pending', $submission->identity_match_status);
/** @var \Mockery\Expectation $expectation */
$expectation = $logSpy->shouldHaveReceived('warning');
$expectation->with(
'form-builder.identity-match.no_person_subject_post_apply',
\Mockery::type('array'),
);
}
public function test_linked_person_is_marked_matched(): void