@@ -259,32 +259,6 @@ public function testRecordsCauseAttributeForChildWorkflowStartFailure(): void
259259 self ::assertArrayNotHasKey ('failure_kind ' , $ history [0 ]->attributes );
260260 }
261261
262- public function testRecordsSerializeErrorAttributeWhenEventSerializationFails (): void
263- {
264- $ writer = $ this ->newWriter ('serr.log ' );
265- $ stub = $ this ->createMock (WorkflowStubInterface::class);
266- $ stub ->method ('getExecution ' )->willReturn (new WorkflowExecution ('wf-serr ' , 'run-1 ' ));
267-
268- $ event = $ this ->createMock (HistoryEvent::class);
269- $ event ->method ('getEventId ' )->willReturn (7 );
270- $ event ->method ('getEventType ' )->willReturn (EventType::EVENT_TYPE_WORKFLOW_EXECUTION_STARTED );
271- $ event ->method ('getEventTime ' )->willReturn (null );
272- $ event ->method ('serializeToJsonString ' )->willThrowException (new \RuntimeException ('bad-utf8 ' ));
273-
274- $ client = $ this ->createMock (WorkflowClientInterface::class);
275- $ client ->method ('getWorkflowHistory ' )->willReturn ($ this ->makeHistory ([$ event ]));
276-
277- (new WorkflowHistoryDumper ())->dump ($ writer , $ client , [$ stub ]);
278- $ writer ->flush ();
279-
280- $ reader = new TranscriptReader ($ this ->directory );
281- $ history = $ reader ->findBySection (TranscriptSection::HISTORY );
282- self ::assertCount (1 , $ history );
283- self ::assertSame (7 , $ history [0 ]->attributes ['event_id ' ]);
284- self ::assertSame ('bad-utf8 ' , $ history [0 ]->attributes ['serialize_error ' ]);
285- self ::assertSame ('{} ' , $ history [0 ]->payload ['attrs ' ]);
286- }
287-
288262 private function newWriter (string $ name ): TranscriptWriter
289263 {
290264 return new TranscriptWriter ($ this ->directory . '/ ' . $ name );
0 commit comments