-
Notifications
You must be signed in to change notification settings - Fork 11.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[5.6] Fix cache for loggers #23118
[5.6] Fix cache for loggers #23118
Conversation
Could you add some tests to show it is getting the same instance? That will help prevent regressions later. |
@laurencei done |
tests/Log/LogManagerTest.php
Outdated
$logger1 = $manager->channel('single')->getLogger(); | ||
$logger2 = $manager->channel('single')->getLogger(); | ||
|
||
$this->assertEquals(spl_object_id($logger1), spl_object_id($logger2)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could probably be an $this->assertSame($logger1, $logger2);
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just do assertSame on the objects.
tests/Log/LogManagerTest.php
Outdated
$logger1 = $manager->channel('single')->getLogger(); | ||
$logger2 = $manager->channel('single')->getLogger(); | ||
|
||
$this->assertEquals(spl_object_id($logger1), spl_object_id($logger2)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just do assertSame on the objects.
@GrahamCampbell done. I realise I opened this PR into the wrong branch. I intended this PR for 5.6 (it's a bug fix), should I open a new PR? |
Hard reset your branch to 5.6, then cherry-pick your commits and force push. |
Thanks. Done. |
This fixes #23117