File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -196,4 +196,36 @@ public function testMaskSensitiveData(): void
196196 $ this ->assertSame (['password ' => '****************** ' ], $ newTrace [0 ]['args ' ][2 ]);
197197 $ this ->assertSame (['password ' => '****************** ' ], $ newTrace [0 ]['args ' ][3 ]['default ' ]);
198198 }
199+
200+ public function testMaskSensitiveDataTraceDataKey (): void
201+ {
202+ $ maskSensitiveData = $ this ->getPrivateMethodInvoker ($ this ->exception , 'maskSensitiveData ' );
203+
204+ $ trace = [
205+ 0 => [
206+ 'file ' => '/var/www/CodeIgniter4/app/Controllers/Home.php ' ,
207+ 'line ' => 15 ,
208+ 'function ' => 'f ' ,
209+ 'class ' => 'App \\Controllers \\Home ' ,
210+ 'type ' => '-> ' ,
211+ 'args ' => [
212+ ],
213+ ],
214+ 1 => [
215+ 'file ' => '/var/www/CodeIgniter4/system/CodeIgniter.php ' ,
216+ 'line ' => 932 ,
217+ 'function ' => 'index ' ,
218+ 'class ' => 'App \\Controllers \\Home ' ,
219+ 'type ' => '-> ' ,
220+ 'args ' => [
221+ ],
222+ ],
223+ ];
224+ $ keysToMask = ['file ' ];
225+ $ path = '' ;
226+
227+ $ newTrace = $ maskSensitiveData ($ trace , $ keysToMask , $ path );
228+
229+ $ this ->assertSame ('/var/www/CodeIgniter4/app/Controllers/Home.php ' , $ newTrace [0 ]['file ' ]);
230+ }
199231}
You can’t perform that action at this time.
0 commit comments