Subversion-Projekte lars-tiefland.php_share

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
1 lars 1
--TEST--
2
XML_Query2XML::getFlatXML(): Case01
3
--SKIPIF--
4
<?php require_once dirname(dirname(__FILE__)) . '/skipif.php'; ?>
5
--FILE--
6
<?php
7
require_once 'XML/Query2XML.php';
8
require_once dirname(dirname(__FILE__)) . '/db_init.php';
9
$query2xml = XML_Query2XML::factory($db);
10
$dom = $query2xml->getFlatXML(
11
    "SELECT
12
        *
13
     FROM
14
        artist
15
     ORDER BY
16
        artistid",
17
    'music_library',
18
    'artist');
19
 
20
header('Content-Type: application/xml');
21
 
22
$dom->formatOutput = true;
23
print $dom->saveXML();
24
?>
25
--EXPECT--
26
<?xml version="1.0" encoding="UTF-8"?>
27
<music_library>
28
  <artist>
29
    <artistid>1</artistid>
30
    <name>Curtis Mayfield</name>
31
    <birth_year>1920</birth_year>
32
    <birth_place>Chicago</birth_place>
33
    <genre>Soul</genre>
34
  </artist>
35
  <artist>
36
    <artistid>2</artistid>
37
    <name>Isaac Hayes</name>
38
    <birth_year>1942</birth_year>
39
    <birth_place>Tennessee</birth_place>
40
    <genre>Soul</genre>
41
  </artist>
42
  <artist>
43
    <artistid>3</artistid>
44
    <name>Ray Charles</name>
45
    <birth_year>1930</birth_year>
46
    <birth_place>Mississippi</birth_place>
47
    <genre>Country and Soul</genre>
48
  </artist>
49
</music_library>