1
0
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:
Jordi Boggiano
2014-03-31 19:22:13 +02:00
5 changed files with 47 additions and 7 deletions

View File

@@ -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']);
}
}

View File

@@ -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']);
}
}