@@ -89,6 +89,34 @@ public function handleKernelRequestEventDataProvider(): \Generator
8989 new UserDataBag (),
9090 ];
9191
92+ yield 'options.data_collection.user_info = FALSE overrides send_default_pii ' => [
93+ new RequestEvent (
94+ $ this ->createMock (HttpKernelInterface::class),
95+ new Request ([], [], [], [], [], ['REMOTE_ADDR ' => '127.0.0.1 ' ]),
96+ \defined (HttpKernelInterface::class . '::MAIN_REQUEST ' ) ? HttpKernelInterface::MAIN_REQUEST : (int ) \constant (HttpKernelInterface::class . '::MASTER_REQUEST ' )
97+ ),
98+ $ this ->getMockedClientWithOptions (new Options ([
99+ 'send_default_pii ' => true ,
100+ 'data_collection ' => ['user_info ' => false ],
101+ ])),
102+ new UserDataBag (),
103+ new UserDataBag (),
104+ ];
105+
106+ yield 'options.data_collection.user_info = TRUE overrides send_default_pii ' => [
107+ new RequestEvent (
108+ $ this ->createMock (HttpKernelInterface::class),
109+ new Request ([], [], [], [], [], ['REMOTE_ADDR ' => '127.0.0.1 ' ]),
110+ \defined (HttpKernelInterface::class . '::MAIN_REQUEST ' ) ? HttpKernelInterface::MAIN_REQUEST : (int ) \constant (HttpKernelInterface::class . '::MASTER_REQUEST ' )
111+ ),
112+ $ this ->getMockedClientWithOptions (new Options ([
113+ 'send_default_pii ' => false ,
114+ 'data_collection ' => ['user_info ' => true ],
115+ ])),
116+ new UserDataBag (),
117+ new UserDataBag (null , null , '127.0.0.1 ' ),
118+ ];
119+
92120 yield 'request.clientIp IS NULL ' => [
93121 new RequestEvent (
94122 $ this ->createMock (HttpKernelInterface::class),
0 commit comments