ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
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 
12 namespace 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 }
getRecord($level=Logger::WARNING, $message='test', $context=array())
Definition: TestCase.php:19
testProcessorWithoutFormatting()
Monolog::__invoke Monolog::formatBytes
testProcessor()
Monolog::__invoke Monolog::formatBytes
Injects memory_get_usage in all records.