1
0
mirror of https://github.com/Seldaek/monolog.git synced 2025-08-05 04:37:38 +02:00

Add unique_id to extra data only if present in the server environment

This commit is contained in:
Matthias Pigulla
2013-10-10 10:04:29 +02:00
parent 16f05a17e3
commit 540afb4621
2 changed files with 17 additions and 1 deletions

View File

@@ -60,6 +60,19 @@ class WebProcessorTest extends TestCase
$this->assertNull($record['extra']['referrer']);
}
public function testProcessorDoesNotAddUniqueIdIfNotPresent()
{
$server = array(
'REQUEST_URI' => 'A',
'REMOTE_ADDR' => 'B',
'REQUEST_METHOD' => 'C',
'SERVER_NAME' => 'F',
);
$processor = new WebProcessor($server);
$record = $processor($this->getRecord());
$this->assertFalse(isset($record['extra']['unique_id']));
}
/**
* @expectedException UnexpectedValueException
*/