ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
MemoryUsageProcessorTest.php
Go to the documentation of this file.
1<?php
2
3/*
4 * This file is part of the Monolog package.
5 *
6 * (c) Jordi Boggiano <j.boggiano@seld.be>
7 *
8 * For the full copyright and license information, please view the LICENSE
9 * file that was distributed with this source code.
10 */
11
12namespace Monolog\Processor;
13
15
17{
22 public function testProcessor()
23 {
24 $processor = new MemoryUsageProcessor();
25 $record = $processor($this->getRecord());
26 $this->assertArrayHasKey('memory_usage', $record['extra']);
27 $this->assertRegExp('#[0-9.]+ (M|K)?B$#', $record['extra']['memory_usage']);
28 }
29
35 {
36 $processor = new MemoryUsageProcessor(true, false);
37 $record = $processor($this->getRecord());
38 $this->assertArrayHasKey('memory_usage', $record['extra']);
39 $this->assertInternalType('int', $record['extra']['memory_usage']);
40 $this->assertGreaterThan(0, $record['extra']['memory_usage']);
41 }
42}
testProcessorWithoutFormatting()
@covers Monolog\Processor\MemoryUsageProcessor::__invoke @covers Monolog\Processor\MemoryProcessor::f...
testProcessor()
@covers Monolog\Processor\MemoryUsageProcessor::__invoke @covers Monolog\Processor\MemoryProcessor::f...
Injects memory_get_usage in all records.
getRecord($level=Logger::WARNING, $message='test', $context=array())
Definition: TestCase.php:19