source: branches/1.2/workflow/inc/log/tests/display.phpt @ 1349

Revision 1349, 1.5 KB checked in by niltonneto, 15 years ago (diff)

Ticket #561 - Inclusão do módulo Workflow faltante nessa versão.

  • Property svn:executable set to *
Line 
1--TEST--
2Log: Display Handler
3--FILE--
4<?php
5
6require_once 'Log.php';
7
8function test($name, $conf)
9{
10    echo "\nTesting $name Configuration\n";
11    echo "------------------------------------------------------\n";
12
13    $logger = &Log::factory('display', '', $name, $conf);
14
15    $logger->log("Info", PEAR_LOG_INFO);
16    $logger->log("Error", PEAR_LOG_ERR);
17    $logger->log("Debug", PEAR_LOG_DEBUG);
18    $logger->log("Multi\nLine\nEntry", PEAR_LOG_INFO);
19
20    echo "\n";
21}
22
23test('Default', array());
24test('Line Break', array('linebreak' => "\n"));
25test('Format', array('lineFormat' => '<!-- %4$s -->'));
26test('Prepend / Append', array('error_prepend' => '<tt>',
27                               'error_append' => '</tt>'));
28
29--EXPECT--
30Testing Default Configuration
31------------------------------------------------------
32<b>info</b>: Info<br />
33<b>error</b>: Error<br />
34<b>debug</b>: Debug<br />
35<b>info</b>: Multi<br />
36Line<br />
37Entry<br />
38
39
40Testing Line Break Configuration
41------------------------------------------------------
42<b>info</b>: Info
43<b>error</b>: Error
44<b>debug</b>: Debug
45<b>info</b>: Multi<br />
46Line<br />
47Entry
48
49
50Testing Format Configuration
51------------------------------------------------------
52<!-- Info --><br />
53<!-- Error --><br />
54<!-- Debug --><br />
55<!-- Multi<br />
56Line<br />
57Entry --><br />
58
59
60Testing Prepend / Append Configuration
61------------------------------------------------------
62<tt><b>info</b>: Info</tt><br />
63<tt><b>error</b>: Error</tt><br />
64<tt><b>debug</b>: Debug</tt><br />
65<tt><b>info</b>: Multi<br />
66Line<br />
67Entry</tt><br />
Note: See TracBrowser for help on using the repository browser.