| 1 |
lars |
1 |
--TEST--
|
|
|
2 |
Log: Window Handler (Output Buffering)
|
|
|
3 |
--INI--
|
|
|
4 |
date.timezone=UTC
|
|
|
5 |
output_buffering=on
|
|
|
6 |
--FILE--
|
|
|
7 |
<?php
|
|
|
8 |
|
|
|
9 |
require_once 'Log.php';
|
|
|
10 |
|
|
|
11 |
$conf = array('title' => 'Test Output');
|
|
|
12 |
$logger = Log::singleton('win', 'test', 'ident', $conf);
|
|
|
13 |
|
|
|
14 |
for ($i = 0; $i < 3; $i++) {
|
|
|
15 |
$logger->log("Log entry $i");
|
|
|
16 |
}
|
|
|
17 |
|
|
|
18 |
--EXPECTF--
|
|
|
19 |
<script language="JavaScript">
|
|
|
20 |
test = window.open('', 'test', 'toolbar=no,scrollbars,width=600,height=400');
|
|
|
21 |
test.document.writeln('<html>');
|
|
|
22 |
test.document.writeln('<head>');
|
|
|
23 |
test.document.writeln('<title>Test Output</title>');
|
|
|
24 |
test.document.writeln('<style type="text/css">');
|
|
|
25 |
test.document.writeln('body { font-family: monospace; font-size: 8pt; }');
|
|
|
26 |
test.document.writeln('td,th { font-size: 8pt; }');
|
|
|
27 |
test.document.writeln('td,th { border-bottom: #999999 solid 1px; }');
|
|
|
28 |
test.document.writeln('td,th { border-right: #999999 solid 1px; }');
|
|
|
29 |
test.document.writeln('tr { text-align: left; vertical-align: top; }');
|
|
|
30 |
test.document.writeln('td.l0 { color: red; }');
|
|
|
31 |
test.document.writeln('td.l1 { color: orange; }');
|
|
|
32 |
test.document.writeln('td.l2 { color: yellow; }');
|
|
|
33 |
test.document.writeln('td.l3 { color: green; }');
|
|
|
34 |
test.document.writeln('td.l4 { color: blue; }');
|
|
|
35 |
test.document.writeln('td.l5 { color: indigo; }');
|
|
|
36 |
test.document.writeln('td.l6 { color: violet; }');
|
|
|
37 |
test.document.writeln('td.l7 { color: black; }');
|
|
|
38 |
test.document.writeln('</style>');
|
|
|
39 |
test.document.writeln('<script type="text/javascript">');
|
|
|
40 |
test.document.writeln('function scroll() {');
|
|
|
41 |
test.document.writeln(' body = document.getElementById("test");');
|
|
|
42 |
test.document.writeln(' body.scrollTop = body.scrollHeight;');
|
|
|
43 |
test.document.writeln('}');
|
|
|
44 |
test.document.writeln('<\/script>');
|
|
|
45 |
test.document.writeln('</head>');
|
|
|
46 |
test.document.writeln('<body id="test" onclick="scroll()">');
|
|
|
47 |
test.document.writeln('<table border="0" cellpadding="2" cellspacing="0">');
|
|
|
48 |
test.document.writeln('<tr><th>Time</th>');
|
|
|
49 |
test.document.writeln('<th>Ident</th>')
|
|
|
50 |
test.document.writeln('<th>Priority</th><th width="100%">Message</th></tr>');
|
|
|
51 |
</script><script language='JavaScript'>
|
|
|
52 |
test.document.writeln('<tr><td>%i:%i:%i.%i</td><td>ident</td><td>Info</td><td class=\"l6\">Log entry 0</td></tr>');
|
|
|
53 |
self.focus();
|
|
|
54 |
</script>
|
|
|
55 |
<script language='JavaScript'>
|
|
|
56 |
test.document.writeln('<tr><td>%i:%i:%i.%i</td><td>ident</td><td>Info</td><td class=\"l6\">Log entry 1</td></tr>');
|
|
|
57 |
self.focus();
|
|
|
58 |
</script>
|
|
|
59 |
<script language='JavaScript'>
|
|
|
60 |
test.document.writeln('<tr><td>%i:%i:%i.%i</td><td>ident</td><td>Info</td><td class=\"l6\">Log entry 2</td></tr>');
|
|
|
61 |
self.focus();
|
|
|
62 |
</script>
|
|
|
63 |
<script language='JavaScript'>
|
|
|
64 |
test.document.writeln('</table>');
|
|
|
65 |
self.focus();
|
|
|
66 |
</script>
|
|
|
67 |
<script language='JavaScript'>
|
|
|
68 |
test.document.writeln('</body></html>');
|
|
|
69 |
self.focus();
|
|
|
70 |
</script>
|