Seldaek / monolog

Sends your logs to files, sockets, inboxes, databases and various web services
https://seldaek.github.io/monolog/
MIT License
20.95k stars 1.9k forks source link

Fix IntrospectionProcessor tests resulting in false positives #1896

Closed healsdata closed 2 months ago

healsdata commented 2 months ago

Three tests in IntrospectionProcessorTest (testLevelTooLow, testLevelEqual, testLevelHigher) aren't actually testing anything. Because $expected = $input is a reference, the changes made to $expected['extra'] are made to $input and carried forward to $actual. You can demonstrate this by adding a return $record at the immediate start of InstrospectionProcessor::__invoke -- the tests still pass despite bypassing all the code.

Fixes #1895

Seldaek commented 2 months ago

Thanks, makes sense! This is because it was previously just using arrays and it didn't get migrated correctly in v3.