mirror of
https://github.com/Seldaek/monolog.git
synced 2025-08-11 15:44:34 +02:00
Merge pull request #340 from hver/processors
Added an option to MemoryProcessors to disable formatting.
This commit is contained in:
@@ -26,4 +26,17 @@ class MemoryPeakUsageProcessorTest extends TestCase
|
||||
$this->assertArrayHasKey('memory_peak_usage', $record['extra']);
|
||||
$this->assertRegExp('#[0-9.]+ (M|K)?B$#', $record['extra']['memory_peak_usage']);
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Monolog\Processor\MemoryPeakUsageProcessor::__invoke
|
||||
* @covers Monolog\Processor\MemoryProcessor::formatBytes
|
||||
*/
|
||||
public function testProcessorWithoutFormatting()
|
||||
{
|
||||
$processor = new MemoryPeakUsageProcessor(true, false);
|
||||
$record = $processor($this->getRecord());
|
||||
$this->assertArrayHasKey('memory_peak_usage', $record['extra']);
|
||||
$this->assertInternalType('int', $record['extra']['memory_peak_usage']);
|
||||
$this->assertGreaterThan(0, $record['extra']['memory_peak_usage']);
|
||||
}
|
||||
}
|
||||
|
@@ -26,4 +26,17 @@ class MemoryUsageProcessorTest extends TestCase
|
||||
$this->assertArrayHasKey('memory_usage', $record['extra']);
|
||||
$this->assertRegExp('#[0-9.]+ (M|K)?B$#', $record['extra']['memory_usage']);
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Monolog\Processor\MemoryUsageProcessor::__invoke
|
||||
* @covers Monolog\Processor\MemoryProcessor::formatBytes
|
||||
*/
|
||||
public function testProcessorWithoutFormatting()
|
||||
{
|
||||
$processor = new MemoryUsageProcessor(true, false);
|
||||
$record = $processor($this->getRecord());
|
||||
$this->assertArrayHasKey('memory_usage', $record['extra']);
|
||||
$this->assertInternalType('int', $record['extra']['memory_usage']);
|
||||
$this->assertGreaterThan(0, $record['extra']['memory_usage']);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user