scratch – Blame information for rev

Subversion Repositories:
Rev:
Rev Author Line No. Line
115 office 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  
14 class PsrLogMessageProcessorTest extends \PHPUnit_Framework_TestCase
15 {
16 /**
17 * @dataProvider getPairs
18 */
19 public function testReplacement($val, $expected)
20 {
21 $proc = new PsrLogMessageProcessor;
22  
23 $message = $proc(array(
24 'message' => '{foo}',
25 'context' => array('foo' => $val),
26 ));
27 $this->assertEquals($expected, $message['message']);
28 }
29  
30 public function getPairs()
31 {
32 return array(
33 array('foo', 'foo'),
34 array('3', '3'),
35 array(3, '3'),
36 array(null, ''),
37 array(true, '1'),
38 array(false, ''),
39 array(new \stdClass, '[object stdClass]'),
40 array(array(), '[array]'),
41 );
42 }
43 }