mirror of
https://github.com/Seldaek/monolog.git
synced 2025-08-11 07:34:12 +02:00
Added overwriting of user context to RavenHandler
This commit is contained in:
@@ -85,6 +85,26 @@ class RavenHandlerTest extends TestCase
|
||||
$this->assertEquals($tags, $ravenClient->lastData['tags']);
|
||||
}
|
||||
|
||||
public function testUserContext()
|
||||
{
|
||||
$ravenClient = $this->getRavenClient();
|
||||
$handler = $this->getHandler($ravenClient);
|
||||
|
||||
$user = array(
|
||||
'id' => '123',
|
||||
'email' => 'test@test.com'
|
||||
);
|
||||
$record = $this->getRecord(Logger::INFO, "test", array('user' => $user));
|
||||
|
||||
$handler->handle($record);
|
||||
$this->assertEquals($user, $ravenClient->context->user);
|
||||
|
||||
$secondRecord = $this->getRecord(Logger::INFO, "test without user");
|
||||
|
||||
$handler->handle($secondRecord);
|
||||
$this->assertNull($ravenClient->context->user);
|
||||
}
|
||||
|
||||
public function testException()
|
||||
{
|
||||
$ravenClient = $this->getRavenClient();
|
||||
|
Reference in New Issue
Block a user