Seldaek / monolog

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

IntrospectionProcessorTests: $expect and $actual are the same object by reference. #1895

Closed healsdata closed 4 months ago

healsdata commented 5 months ago

Monolog version 2

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.

I have a PR for this I'll open in a few minutes.