Subversion-Projekte lars-tiefland.php_share

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
1 lars 1
--TEST--
2
XML Beautifier - Bug #5591: Undefined variable notice when parsing DOCTYPE
3
--FILE--
4
<?php
5
/*
6
 * The bug report complains of a Notice being printed,
7
 * but I cannot duplicate it here.
8
 *
9
 * Note that this test case fails on PHP5 because
10
 * the XML and DOCTYPE tags are not being included in
11
 * the output.  That problem is already reported in
12
 * Bug #5450.  This test case should begin passing
13
 * after #5450 is fixed.
14
 *
15
 * Note also that I'm not sure if the 5-char indention
16
 * of the DOCTYPE attributes is correct behavior.
17
 */
18
 
19
error_reporting(E_ALL);
20
require_once 'XML/Beautifier.php';
21
 
22
/*
23
 * XML is from http://www.samalyse.com/ln/0015.php
24
 */
25
$xml = <<<EOF
26
<?xml version="1.0" encoding="iso-8859-1"?>
27
<!DOCTYPE html
28
     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
29
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
30
<html  xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" lang="fr">
31
<head>
32
 
33
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/>
34
<meta http-equiv="Content-Language" content="fr"/>
35
<meta name="Description" content="Samalyse SARL - Solutions informatiques"/>
36
<meta name="Keywords" content="informatique,linux,d.veloppement,gestion,audio,r.seau,maintenance"/>
37
<meta name="Author" content="Olivier Guilyardi"/>
38
<meta name="Revisit-after" content="5 days"/>
39
<meta name="Robots" content="all"/>
40
<link rel="stylesheet" href="/css/samalyse.css.php?rand=8044&amp;r_bar_size=17" type="text/css" />
41
 
42
<title> Samalyse </title>
43
 
44
</head>
45
 
46
<body>
47
<div style="background: white; "><a name="top" href="/index.php"><img src="/pico/logo4.gif" alt="Samalyse" border="0" width="558" height="60" /></a></div>
48
</body>
49
</html>
50
EOF;
51
 
52
$fmt = new XML_Beautifier();
53
echo $fmt->formatString($xml);
54
?>
55
--EXPECT--
56
<?xml version="1.0" encoding="iso-8859-1" standalone="yes"?>
57
<!DOCTYPE html
58
     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
59
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
60
<html lang="fr" xml:lang="fr" xmlns="http://www.w3.org/1999/xhtml">
61
    <head>
62
        <meta content="text/html; charset=iso-8859-1" http-equiv="Content-Type" />
63
        <meta content="fr" http-equiv="Content-Language" />
64
        <meta content="Samalyse SARL - Solutions informatiques" name="Description" />
65
        <meta content="informatique,linux,d.veloppement,gestion,audio,r.seau,maintenance" name="Keywords" />
66
        <meta content="Olivier Guilyardi" name="Author" />
67
        <meta content="5 days" name="Revisit-after" />
68
        <meta content="all" name="Robots" />
69
        <link href="/css/samalyse.css.php?rand=8044&amp;r_bar_size=17" rel="stylesheet" type="text/css" />
70
        <title>Samalyse</title>
71
    </head>
72
    <body>
73
        <div style="background: white; ">
74
            <a href="/index.php" name="top">
75
                <img alt="Samalyse" border="0" height="60" src="/pico/logo4.gif" width="558" />
76
            </a>
77
        </div>
78
    </body>
79
</html>