['message' => $messageA], 'bar' => ['message' => $errorA], ])->withMessage($errorB); $messages = [...(new MessagesFlattener($node))->errors()]; self::assertSame('some error message B', (string)$messages[0]); self::assertSame('some error message A', (string)$messages[1]); } }