| 1 |
lars |
1 |
--TEST--
|
|
|
2 |
XML_Query2XML::getXML(): idColumn: FALSE
|
|
|
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->getXML(
|
|
|
11 |
'SELECT * FROM artist',
|
|
|
12 |
array(
|
|
|
13 |
'rootTag' => 'music_library',
|
|
|
14 |
'rowTag' => 'artist',
|
|
|
15 |
'idColumn' => false,
|
|
|
16 |
'attributes' => array(
|
|
|
17 |
'*'
|
|
|
18 |
)
|
|
|
19 |
)
|
|
|
20 |
);
|
|
|
21 |
|
|
|
22 |
header('Content-Type: application/xml');
|
|
|
23 |
|
|
|
24 |
$dom->formatOutput = true;
|
|
|
25 |
print $dom->saveXML();
|
|
|
26 |
?>
|
|
|
27 |
--EXPECT--
|
|
|
28 |
<?xml version="1.0" encoding="UTF-8"?>
|
|
|
29 |
<music_library>
|
|
|
30 |
<artist artistid="1" name="Curtis Mayfield" birth_year="1920" birth_place="Chicago" genre="Soul"/>
|
|
|
31 |
<artist artistid="2" name="Isaac Hayes" birth_year="1942" birth_place="Tennessee" genre="Soul"/>
|
|
|
32 |
<artist artistid="3" name="Ray Charles" birth_year="1930" birth_place="Mississippi" genre="Country and Soul"/>
|
|
|
33 |
</music_library>
|