function LoggerChannelTest::testLogRecursionProtection
Tests LoggerChannel::log() recursion protection.
@covers ::log
File
-
core/
tests/ Drupal/ Tests/ Core/ Logger/ LoggerChannelTest.php, line 75
Class
- LoggerChannelTest
- @coversDefaultClass \Drupal\Core\Logger\LoggerChannel[[api-linebreak]] @group Logger
Namespace
Drupal\Tests\Core\LoggerCode
public function testLogRecursionProtection() : void {
$channel = new LoggerChannel('test');
$logger = $this->createMock('Psr\\Log\\LoggerInterface');
$logger->expects($this->exactly(LoggerChannel::MAX_CALL_DEPTH))
->method('log');
$channel->addLogger($logger);
$channel->addLogger(new NaughtyRecursiveLogger($channel));
$channel->log(rand(0, 7), $this->randomMachineName());
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.