ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
TestCase.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;
13
15{
19 protected function getRecord($level = Logger::WARNING, $message = 'test', $context = array())
20 {
21 return array(
22 'message' => $message,
23 'context' => $context,
24 'level' => $level,
25 'level_name' => Logger::getLevelName($level),
26 'channel' => 'test',
27 'datetime' => \DateTime::createFromFormat('U.u', sprintf('%.6F', microtime(true))),
28 'extra' => array(),
29 );
30 }
31
35 protected function getMultipleRecords()
36 {
37 return array(
38 $this->getRecord(Logger::DEBUG, 'debug message 1'),
39 $this->getRecord(Logger::DEBUG, 'debug message 2'),
40 $this->getRecord(Logger::INFO, 'information'),
41 $this->getRecord(Logger::WARNING, 'warning'),
42 $this->getRecord(Logger::ERROR, 'error')
43 );
44 }
45
49 protected function getIdentityFormatter()
50 {
51 $formatter = $this->getMock('Monolog\\Formatter\\FormatterInterface');
52 $formatter->expects($this->any())
53 ->method('format')
54 ->will($this->returnCallback(function ($record) { return $record['message']; }));
55
56 return $formatter;
57 }
58}
getRecord($level=Logger::WARNING, $message='test', $context=array())
Definition: TestCase.php:19
const DEBUG