cvs: pear /XML_Query2XML/tests/XML_Query2XML/ADOdbDefault/getXML dynamicRowTag_callback.phpt dynamicRowTag_columnName.phpt
dynamicRowTag_columnName_ignoreRowTag.phpt dynamicRowTag_columnName_onRootLevel.phpt dynamicRowTag_commandObject.phpt dynamicRowTag_staticString.phpt
/XML_Query2XML/tests/XML_Query2XML/ADOdbException/getXML dynamicRowTag_callback.phpt dynamicRowTag_columnName.phpt
dynamicRowTag_columnName_ignoreRowTag.phpt dynamicRowTag_columnName_onRootLevel.phpt dynamicRowTag_commandObject.phpt dynamicRowTag_staticString.phpt
/XML_Query2XML/tests/XML_Query2XML/ADOdbPEAR/getXML dynamicRowTag_callback.phpt dynamicRowTag_columnName.phpt
dynamicRowTag_columnName_ignoreRowTag.phpt dynamicRowTag_columnName_onRootLevel.phpt dynamicRowTag_commandObject.phpt dynamicRowTag_staticString.phpt
/XML_Query2XML/tests/XML_Query2XML/DB/getXML dynamicRowTag_callback.phpt dynamicRowTag_columnName.phpt dynamicRowTag_columnName_ignoreRowTag.phpt
dynamicRowTag_columnName_onRootLe! vel.phpt dynamicRowTag_commandObject.phpt dynamicRowTag_staticString.phpt
/XML_Query2XML/tests/XML_Query2XML/MDB2/getXML dynamicRowTag_callback.phpt dynamicRowTag_columnName.phpt dynamicRowTag_columnName_ignoreRowTag.phpt
dynamicRowTag_columnName_onRootLevel.phpt dynamicRowTag_commandObject.phpt dynamicRowTag_staticString.phpt
| From: | Lukas Feiler | Date: | Sun, 26 Aug 2007 06:49:31 +0000 |
| Subject: | cvs: pear /XML_Query2XML/tests/XML_Query2XML/ADOdbDefault/getXML dynamicRowTag_callback.phpt dynamicRowTag_columnName.phpt dynamicRowTag_columnName_ignoreRowTag.phpt dynamicRowTag_columnName_onRootLevel.phpt dynamicRowTag_commandObject.phpt dynamicRowTag_staticString.phpt /XML_Query2XML/tests/XML_Query2XML/ADOdbException/getXML dynamicRowTag_callback.phpt dynamicRowTag_columnName.phpt dynamicRowTag_columnName_ignoreRowTag.phpt dynamicRowTag_columnName_onRootLevel.phpt dynamicRowTag_commandObject.phpt dynamicRowTag_staticString.phpt /XML_Query2XML/tests/XML_Query2XML/ADOdbPEAR/getXML dynamicRowTag_callback.phpt dynamicRowTag_columnName.phpt dynamicRowTag_columnName_ignoreRowTag.phpt dynamicRowTag_columnName_onRootLevel.phpt dynamicRowTag_commandObject.phpt dynamicRowTag_staticString.phpt /XML_Query2XML/tests/XML_Query2XML/DB/getXML dynamicRowTag_callback.phpt dynamicRowTag_columnName.phpt dynamicRowTag_columnName_ignoreRowTag.phpt dynamicRowTag_columnName_onRootLe! vel.phpt dynamicRowTag_commandObject.phpt dynamicRowTag_staticString.phpt /XML_Query2XML/tests/XML_Query2XML/MDB2/getXML dynamicRowTag_callback.phpt dynamicRowTag_columnName.phpt dynamicRowTag_columnName_ignoreRowTag.phpt dynamicRowTag_columnName_onRootLevel.phpt dynamicRowTag_commandObject.phpt dynamicRowTag_staticString.phpt |
||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-48507@lists.php.net to get a copy of this message | ||
lukasfeiler Sun Aug 26 06:49:31 2007 UTC
Added files:
/pear/XML_Query2XML/tests/XML_Query2XML/ADOdbDefault/getXML
dynamicRowTag_callback.phpt
dynamicRowTag_columnName.phpt
dynamicRowTag_columnName_ignoreRowTag.phpt
dynamicRowTag_columnName_onRootLevel.phpt
dynamicRowTag_commandObject.phpt
dynamicRowTag_staticString.phpt
/pear/XML_Query2XML/tests/XML_Query2XML/ADOdbException/getXML
dynamicRowTag_callback.phpt
dynamicRowTag_columnName.phpt
dynamicRowTag_columnName_ignoreRowTag.phpt
dynamicRowTag_columnName_onRootLevel.phpt
dynamicRowTag_commandObject.phpt
dynamicRowTag_staticString.phpt
/pear/XML_Query2XML/tests/XML_Query2XML/ADOdbPEAR/getXML
dynamicRowTag_callback.phpt
dynamicRowTag_columnName.phpt
dynamicRowTag_columnName_ignoreRowTag.phpt
dynamicRowTag_columnName_onRootLevel.phpt
dynamicRowTag_commandObject.phpt
dynamicRowTag_staticString.phpt
/pear/XML_Query2XML/tests/XML_Query2XML/DB/getXML
dynamicRowTag_callback.phpt
dynamicRowTag_columnName.phpt
dynamicRowTag_columnName_ignoreRowTag.phpt
dynamicRowTag_columnName_onRootLevel.phpt
dynamicRowTag_commandObject.phpt
dynamicRowTag_staticString.phpt
/pear/XML_Query2XML/tests/XML_Query2XML/MDB2/getXML
dynamicRowTag_callback.phpt
dynamicRowTag_columnName.phpt
dynamicRowTag_columnName_ignoreRowTag.phpt
dynamicRowTag_columnName_onRootLevel.phpt
dynamicRowTag_commandObject.phpt
dynamicRowTag_staticString.phpt
Log:
new unit tests for new dynamicRowTag option
http://cvs.php.net/viewvc.cgi/pear/XML_Query2XML/tests/XML_Query2XML/ADOdbDefault/getXML/dynamicRowTag_callback.phpt?view=markup&rev=1.1 Index: pear/XML_Query2XML/tests/XML_Query2XML/ADOdbDefault/getXML/dynamicRowTag_callback.phpt +++ pear/XML_Query2XML/tests/XML_Query2XML/ADOdbDefault/getXML/dynamicRowTag_callback.phpt --TEST-- XML_Query2XML::getXML(): dynamicRowTag: callback function --SKIPIF-- <?php require_once dirname(dirname(__FILE__)) . '/skipif.php'; ?> --FILE-- <?php function getRowTagName($record) { return $record['last_name']; } require_once 'XML/Query2XML.php'; require_once dirname(dirname(__FILE__)) . '/db_init.php'; $query2xml = XML_Query2XML::factory($db); $dom = $query2xml->getXML( "SELECT * FROM customer", array( 'rootTag' => 'customers', 'idColumn' => 'customerid', 'rowTag' => 'customer', 'elements' => array( 'customerid', 'name_and_email' => array( 'dynamicRowTag' => '#getRowTagName', 'value' => 'email' ) ) ) ); header('Content-Type: application/xml'); $dom->formatOutput = true; print $dom->saveXML(); ?> --EXPECT-- <?xml version="1.0" encoding="UTF-8"?> <customers> <customer> <customerid>1</customerid> <Doe>jane.doe@example.com</Doe> </customer> <customer> <customerid>2</customerid> <Doe>john.doe@example.com</Doe> </customer> <customer> <customerid>3</customerid> <Green>susan.green@example.com</Green> </customer> <customer> <customerid>4</customerid> <Alt>victory.alt@example.com</Alt> </customer> <customer> <customerid>5</customerid> <Rippy>will.wippy@example.com</Rippy> </customer> <customer> <customerid>6</customerid> <Raw>tim.raw@example.com</Raw> </customer> <customer> <customerid>7</customerid> <Fallow>nick.fallow@example.com</Fallow> </customer> <customer> <customerid>8</customerid> <Burton>ed.burton@example.com</Burton> </customer> <customer> <customerid>9</customerid> <Woo>jack.woo@example.com</Woo> </customer> <customer> <customerid>10</customerid> <Gonzales>maria.gonzales@example.com</Gonzales> </customer> </customers> http://cvs.php.net/viewvc.cgi/pear/XML_Query2XML/tests/XML_Query2XML/ADOdbDefault/getXML/dynamicRowTag_columnName.phpt?view=markup&rev=1.1 Index: pear/XML_Query2XML/tests/XML_Query2XML/ADOdbDefault/getXML/dynamicRowTag_columnName.phpt +++ pear/XML_Query2XML/tests/XML_Query2XML/ADOdbDefault/getXML/dynamicRowTag_columnName.phpt --TEST-- XML_Query2XML::getXML(): dynamicRowTag: COLUMN NAME --SKIPIF-- <?php require_once dirname(dirname(__FILE__)) . '/skipif.php'; ?> --FILE-- <?php require_once 'XML/Query2XML.php'; require_once dirname(dirname(__FILE__)) . '/db_init.php'; $query2xml = XML_Query2XML::factory($db); $dom = $query2xml->getXML( "SELECT * FROM customer", array( 'rootTag' => 'customers', 'idColumn' => 'customerid', 'rowTag' => 'customer', 'elements' => array( 'customerid', 'name_and_email' => array( 'dynamicRowTag' => 'first_name', 'value' => 'email' ) ) ) ); header('Content-Type: application/xml'); $dom->formatOutput = true; print $dom->saveXML(); ?> --EXPECT-- <?xml version="1.0" encoding="UTF-8"?> <customers> <customer> <customerid>1</customerid> <Jane>jane.doe@example.com</Jane> </customer> <customer> <customerid>2</customerid> <John>john.doe@example.com</John> </customer> <customer> <customerid>3</customerid> <Susan>susan.green@example.com</Susan> </customer> <customer> <customerid>4</customerid> <Victoria>victory.alt@example.com</Victoria> </customer> <customer> <customerid>5</customerid> <Will>will.wippy@example.com</Will> </customer> <customer> <customerid>6</customerid> <Tim>tim.raw@example.com</Tim> </customer> <customer> <customerid>7</customerid> <Nick>nick.fallow@example.com</Nick> </customer> <customer> <customerid>8</customerid> <Ed>ed.burton@example.com</Ed> </customer> <customer> <customerid>9</customerid> <Jack>jack.woo@example.com</Jack> </customer> <customer> <customerid>10</customerid> <Maria>maria.gonzales@example.com</Maria> </customer> </customers> http://cvs.php.net/viewvc.cgi/pear/XML_Query2XML/tests/XML_Query2XML/ADOdbDefault/getXML/dynamicRowTag_columnName_ignoreRowTag.phpt?view=markup&rev=1.1 Index: pear/XML_Query2XML/tests/XML_Query2XML/ADOdbDefault/getXML/dynamicRowTag_columnName_ignoreRowTag.phpt +++ pear/XML_Query2XML/tests/XML_Query2XML/ADOdbDefault/getXML/dynamicRowTag_columnName_ignoreRowTag.phpt --TEST-- XML_Query2XML::getXML(): dynamicRowTag: ignoring $options['rowTag'] --SKIPIF-- <?php require_once dirname(dirname(__FILE__)) . '/skipif.php'; ?> --FILE-- <?php require_once 'XML/Query2XML.php'; require_once dirname(dirname(__FILE__)) . '/db_init.php'; $query2xml = XML_Query2XML::factory($db); $dom = $query2xml->getXML( "SELECT * FROM customer", array( 'rootTag' => 'customers', 'idColumn' => 'customerid', 'rowTag' => 'customer', 'elements' => array( 'customerid', 'name_and_email' => array( 'rowTag' => 'ignore_me', 'dynamicRowTag' => 'first_name', 'value' => 'email' ) ) ) ); header('Content-Type: application/xml'); $dom->formatOutput = true; print $dom->saveXML(); ?> --EXPECT-- <?xml version="1.0" encoding="UTF-8"?> <customers> <customer> <customerid>1</customerid> <Jane>jane.doe@example.com</Jane> </customer> <customer> <customerid>2</customerid> <John>john.doe@example.com</John> </customer> <customer> <customerid>3</customerid> <Susan>susan.green@example.com</Susan> </customer> <customer> <customerid>4</customerid> <Victoria>victory.alt@example.com</Victoria> </customer> <customer> <customerid>5</customerid> <Will>will.wippy@example.com</Will> </customer> <customer> <customerid>6</customerid> <Tim>tim.raw@example.com</Tim> </customer> <customer> <customerid>7</customerid> <Nick>nick.fallow@example.com</Nick> </customer> <customer> <customerid>8</customerid> <Ed>ed.burton@example.com</Ed> </customer> <customer> <customerid>9</customerid> <Jack>jack.woo@example.com</Jack> </customer> <customer> <customerid>10</customerid> <Maria>maria.gonzales@example.com</Maria> </customer> </customers> http://cvs.php.net/viewvc.cgi/pear/XML_Query2XML/tests/XML_Query2XML/ADOdbDefault/getXML/dynamicRowTag_columnName_onRootLevel.phpt?view=markup&rev=1.1 Index: pear/XML_Query2XML/tests/XML_Query2XML/ADOdbDefault/getXML/dynamicRowTag_columnName_onRootLevel.phpt +++ pear/XML_Query2XML/tests/XML_Query2XML/ADOdbDefault/getXML/dynamicRowTag_columnName_onRootLevel.phpt --TEST-- XML_Query2XML::getXML(): dynamicRowTag: COLUMN NAME on root level --SKIPIF-- <?php require_once dirname(dirname(__FILE__)) . '/skipif.php'; ?> --FILE-- <?php require_once 'XML/Query2XML.php'; require_once dirname(dirname(__FILE__)) . '/db_init.php'; $query2xml = XML_Query2XML::factory($db); $dom = $query2xml->getXML( "SELECT * FROM customer", array( 'rootTag' => 'customers', 'idColumn' => 'customerid', 'dynamicRowTag' => 'first_name', 'value' => 'email' ) ); header('Content-Type: application/xml'); $dom->formatOutput = true; print $dom->saveXML(); ?> --EXPECT-- <?xml version="1.0" encoding="UTF-8"?> <customers> <Jane>jane.doe@example.com</Jane> <John>john.doe@example.com</John> <Susan>susan.green@example.com</Susan> <Victoria>victory.alt@example.com</Victoria> <Will>will.wippy@example.com</Will> <Tim>tim.raw@example.com</Tim> <Nick>nick.fallow@example.com</Nick> <Ed>ed.burton@example.com</Ed> <Jack>jack.woo@example.com</Jack> <Maria>maria.gonzales@example.com</Maria> </customers> http://cvs.php.net/viewvc.cgi/pear/XML_Query2XML/tests/XML_Query2XML/ADOdbDefault/getXML/dynamicRowTag_commandObject.phpt?view=markup&rev=1.1 Index: pear/XML_Query2XML/tests/XML_Query2XML/ADOdbDefault/getXML/dynamicRowTag_commandObject.phpt +++ pear/XML_Query2XML/tests/XML_Query2XML/ADOdbDefault/getXML/dynamicRowTag_commandObject.phpt --TEST-- XML_Query2XML::getXML(): dynamicRowTag: COMMAND OBJECT --SKIPIF-- <?php require_once dirname(dirname(__FILE__)) . '/skipif.php'; ?> --FILE-- <?php require_once 'XML/Query2XML.php'; require_once 'XML/Query2XML/Callback.php'; require_once dirname(dirname(__FILE__)) . '/db_init.php'; class RowTagGenerator implements XML_Query2XML_Callback { public function execute(array $record) { return $record['last_name']; } } $query2xml = XML_Query2XML::factory($db); $dom = $query2xml->getXML( "SELECT * FROM customer", array( 'rootTag' => 'customers', 'idColumn' => 'customerid', 'rowTag' => 'customer', 'elements' => array( 'customerid', 'name_and_email' => array( 'dynamicRowTag' => new RowTagGenerator(), 'value' => 'email' ) ) ) ); header('Content-Type: application/xml'); $dom->formatOutput = true; print $dom->saveXML(); ?> --EXPECT-- <?xml version="1.0" encoding="UTF-8"?> <customers> <customer> <customerid>1</customerid> <Doe>jane.doe@example.com</Doe> </customer> <customer> <customerid>2</customerid> <Doe>john.doe@example.com</Doe> </customer> <customer> <customerid>3</customerid> <Green>susan.green@example.com</Green> </customer> <customer> <customerid>4</customerid> <Alt>victory.alt@example.com</Alt> </customer> <customer> <customerid>5</customerid> <Rippy>will.wippy@example.com</Rippy> </customer> <customer> <customerid>6</customerid> <Raw>tim.raw@example.com</Raw> </customer> <customer> <customerid>7</customerid> <Fallow>nick.fallow@example.com</Fallow> </customer> <customer> <customerid>8</customerid> <Burton>ed.burton@example.com</Burton> </customer> <customer> <customerid>9</customerid> <Woo>jack.woo@example.com</Woo> </customer> <customer> <customerid>10</customerid> <Gonzales>maria.gonzales@example.com</Gonzales> </customer> </customers> http://cvs.php.net/viewvc.cgi/pear/XML_Query2XML/tests/XML_Query2XML/ADOdbDefault/getXML/dynamicRowTag_staticString.phpt?view=markup&rev=1.1 Index: pear/XML_Query2XML/tests/XML_Query2XML/ADOdbDefault/getXML/dynamicRowTag_staticString.phpt +++ pear/XML_Query2XML/tests/XML_Query2XML/ADOdbDefault/getXML/dynamicRowTag_staticString.phpt --TEST-- XML_Query2XML::getXML(): dynamicRowTag: static string --SKIPIF-- <?php require_once dirname(dirname(__FILE__)) . '/skipif.php'; ?> --FILE-- <?php require_once 'XML/Query2XML.php'; require_once dirname(dirname(__FILE__)) . '/db_init.php'; $query2xml = XML_Query2XML::factory($db); $dom = $query2xml->getXML( "SELECT * FROM customer", array( 'rootTag' => 'customers', 'idColumn' => 'customerid', 'rowTag' => 'customer', 'elements' => array( 'customerid', 'name_and_email' => array( 'dynamicRowTag' => ':email', 'value' => 'email' ) ) ) ); header('Content-Type: application/xml'); $dom->formatOutput = true; print $dom->saveXML(); ?> --EXPECT-- <?xml version="1.0" encoding="UTF-8"?> <customers> <customer> <customerid>1</customerid> <email>jane.doe@example.com</email> </customer> <customer> <customerid>2</customerid> <email>john.doe@example.com</email> </customer> <customer> <customerid>3</customerid> <email>susan.green@example.com</email> </customer> <customer> <customerid>4</customerid> <email>victory.alt@example.com</email> </customer> <customer> <customerid>5</customerid> <email>will.wippy@example.com</email> </customer> <customer> <customerid>6</customerid> <email>tim.raw@example.com</email> </customer> <customer> <customerid>7</customerid> <email>nick.fallow@example.com</email> </customer> <customer> <customerid>8</customerid> <email>ed.burton@example.com</email> </customer> <customer> <customerid>9</customerid> <email>jack.woo@example.com</email> </customer> <customer> <customerid>10</customerid> <email>maria.gonzales@example.com</email> </customer> </customers> http://cvs.php.net/viewvc.cgi/pear/XML_Query2XML/tests/XML_Query2XML/ADOdbException/getXML/dynamicRowTag_callback.phpt?view=markup&rev=1.1 Index: pear/XML_Query2XML/tests/XML_Query2XML/ADOdbException/getXML/dynamicRowTag_callback.phpt +++ pear/XML_Query2XML/tests/XML_Query2XML/ADOdbException/getXML/dynamicRowTag_callback.phpt --TEST-- XML_Query2XML::getXML(): dynamicRowTag: callback function --SKIPIF-- <?php require_once dirname(dirname(__FILE__)) . '/skipif.php'; ?> --FILE-- <?php function getRowTagName($record) { return $record['last_name']; } require_once 'XML/Query2XML.php'; require_once dirname(dirname(__FILE__)) . '/db_init.php'; $query2xml = XML_Query2XML::factory($db); $dom = $query2xml->getXML( "SELECT * FROM customer", array( 'rootTag' => 'customers', 'idColumn' => 'customerid', 'rowTag' => 'customer', 'elements' => array( 'customerid', 'name_and_email' => array( 'dynamicRowTag' => '#getRowTagName', 'value' => 'email' ) ) ) ); header('Content-Type: application/xml'); $dom->formatOutput = true; print $dom->saveXML(); ?> --EXPECT-- <?xml version="1.0" encoding="UTF-8"?> <customers> <customer> <customerid>1</customerid> <Doe>jane.doe@example.com</Doe> </customer> <customer> <customerid>2</customerid> <Doe>john.doe@example.com</Doe> </customer> <customer> <customerid>3</customerid> <Green>susan.green@example.com</Green> </customer> <customer> <customerid>4</customerid> <Alt>victory.alt@example.com</Alt> </customer> <customer> <customerid>5</customerid> <Rippy>will.wippy@example.com</Rippy> </customer> <customer> <customerid>6</customerid> <Raw>tim.raw@example.com</Raw> </customer> <customer> <customerid>7</customerid> <Fallow>nick.fallow@example.com</Fallow> </customer> <customer> <customerid>8</customerid> <Burton>ed.burton@example.com</Burton> </customer> <customer> <customerid>9</customerid> <Woo>jack.woo@example.com</Woo> </customer> <customer> <customerid>10</customerid> <Gonzales>maria.gonzales@example.com</Gonzales> </customer> </customers> http://cvs.php.net/viewvc.cgi/pear/XML_Query2XML/tests/XML_Query2XML/ADOdbException/getXML/dynamicRowTag_columnName.phpt?view=markup&rev=1.1 Index: pear/XML_Query2XML/tests/XML_Query2XML/ADOdbException/getXML/dynamicRowTag_columnName.phpt +++ pear/XML_Query2XML/tests/XML_Query2XML/ADOdbException/getXML/dynamicRowTag_columnName.phpt --TEST-- XML_Query2XML::getXML(): dynamicRowTag: COLUMN NAME --SKIPIF-- <?php require_once dirname(dirname(__FILE__)) . '/skipif.php'; ?> --FILE-- <?php require_once 'XML/Query2XML.php'; require_once dirname(dirname(__FILE__)) . '/db_init.php'; $query2xml = XML_Query2XML::factory($db); $dom = $query2xml->getXML( "SELECT * FROM customer", array( 'rootTag' => 'customers', 'idColumn' => 'customerid', 'rowTag' => 'customer', 'elements' => array( 'customerid', 'name_and_email' => array( 'dynamicRowTag' => 'first_name', 'value' => 'email' ) ) ) ); header('Content-Type: application/xml'); $dom->formatOutput = true; print $dom->saveXML(); ?> --EXPECT-- <?xml version="1.0" encoding="UTF-8"?> <customers> <customer> <customerid>1</customerid> <Jane>jane.doe@example.com</Jane> </customer> <customer> <customerid>2</customerid> <John>john.doe@example.com</John> </customer> <customer> <customerid>3</customerid> <Susan>susan.green@example.com</Susan> </customer> <customer> <customerid>4</customerid> <Victoria>victory.alt@example.com</Victoria> </customer> <customer> <customerid>5</customerid> <Will>will.wippy@example.com</Will> </customer> <customer> <customerid>6</customerid> <Tim>tim.raw@example.com</Tim> </customer> <customer> <customerid>7</customerid> <Nick>nick.fallow@example.com</Nick> </customer> <customer> <customerid>8</customerid> <Ed>ed.burton@example.com</Ed> </customer> <customer> <customerid>9</customerid> <Jack>jack.woo@example.com</Jack> </customer> <customer> <customerid>10</customerid> <Maria>maria.gonzales@example.com</Maria> </customer> </customers> http://cvs.php.net/viewvc.cgi/pear/XML_Query2XML/tests/XML_Query2XML/ADOdbException/getXML/dynamicRowTag_columnName_ignoreRowTag.phpt?view=markup&rev=1.1 Index: pear/XML_Query2XML/tests/XML_Query2XML/ADOdbException/getXML/dynamicRowTag_columnName_ignoreRowTag.phpt +++ pear/XML_Query2XML/tests/XML_Query2XML/ADOdbException/getXML/dynamicRowTag_columnName_ignoreRowTag.phpt --TEST-- XML_Query2XML::getXML(): dynamicRowTag: ignoring $options['rowTag'] --SKIPIF-- <?php require_once dirname(dirname(__FILE__)) . '/skipif.php'; ?> --FILE-- <?php require_once 'XML/Query2XML.php'; require_once dirname(dirname(__FILE__)) . '/db_init.php'; $query2xml = XML_Query2XML::factory($db); $dom = $query2xml->getXML( "SELECT * FROM customer", array( 'rootTag' => 'customers', 'idColumn' => 'customerid', 'rowTag' => 'customer', 'elements' => array( 'customerid', 'name_and_email' => array( 'rowTag' => 'ignore_me', 'dynamicRowTag' => 'first_name', 'value' => 'email' ) ) ) ); header('Content-Type: application/xml'); $dom->formatOutput = true; print $dom->saveXML(); ?> --EXPECT-- <?xml version="1.0" encoding="UTF-8"?> <customers> <customer> <customerid>1</customerid> <Jane>jane.doe@example.com</Jane> </customer> <customer> <customerid>2</customerid> <John>john.doe@example.com</John> </customer> <customer> <customerid>3</customerid> <Susan>susan.green@example.com</Susan> </customer> <customer> <customerid>4</customerid> <Victoria>victory.alt@example.com</Victoria> </customer> <customer> <customerid>5</customerid> <Will>will.wippy@example.com</Will> </customer> <customer> <customerid>6</customerid> <Tim>tim.raw@example.com</Tim> </customer> <customer> <customerid>7</customerid> <Nick>nick.fallow@example.com</Nick> </customer> <customer> <customerid>8</customerid> <Ed>ed.burton@example.com</Ed> </customer> <customer> <customerid>9</customerid> <Jack>jack.woo@example.com</Jack> </customer> <customer> <customerid>10</customerid> <Maria>maria.gonzales@example.com</Maria> </customer> </customers> http://cvs.php.net/viewvc.cgi/pear/XML_Query2XML/tests/XML_Query2XML/ADOdbException/getXML/dynamicRowTag_columnName_onRootLevel.phpt?view=markup&rev=1.1 Index: pear/XML_Query2XML/tests/XML_Query2XML/ADOdbException/getXML/dynamicRowTag_columnName_onRootLevel.phpt +++ pear/XML_Query2XML/tests/XML_Query2XML/ADOdbException/getXML/dynamicRowTag_columnName_onRootLevel.phpt --TEST-- XML_Query2XML::getXML(): dynamicRowTag: COLUMN NAME on root level --SKIPIF-- <?php require_once dirname(dirname(__FILE__)) . '/skipif.php'; ?> --FILE-- <?php require_once 'XML/Query2XML.php'; require_once dirname(dirname(__FILE__)) . '/db_init.php'; $query2xml = XML_Query2XML::factory($db); $dom = $query2xml->getXML( "SELECT * FROM customer", array( 'rootTag' => 'customers', 'idColumn' => 'customerid', 'dynamicRowTag' => 'first_name', 'value' => 'email' ) ); header('Content-Type: application/xml'); $dom->formatOutput = true; print $dom->saveXML(); ?> --EXPECT-- <?xml version="1.0" encoding="UTF-8"?> <customers> <Jane>jane.doe@example.com</Jane> <John>john.doe@example.com</John> <Susan>susan.green@example.com</Susan> <Victoria>victory.alt@example.com</Victoria> <Will>will.wippy@example.com</Will> <Tim>tim.raw@example.com</Tim> <Nick>nick.fallow@example.com</Nick> <Ed>ed.burton@example.com</Ed> <Jack>jack.woo@example.com</Jack> <Maria>maria.gonzales@example.com</Maria> </customers> http://cvs.php.net/viewvc.cgi/pear/XML_Query2XML/tests/XML_Query2XML/ADOdbException/getXML/dynamicRowTag_commandObject.phpt?view=markup&rev=1.1 Index: pear/XML_Query2XML/tests/XML_Query2XML/ADOdbException/getXML/dynamicRowTag_commandObject.phpt +++ pear/XML_Query2XML/tests/XML_Query2XML/ADOdbException/getXML/dynamicRowTag_commandObject.phpt --TEST-- XML_Query2XML::getXML(): dynamicRowTag: COMMAND OBJECT --SKIPIF-- <?php require_once dirname(dirname(__FILE__)) . '/skipif.php'; ?> --FILE-- <?php require_once 'XML/Query2XML.php'; require_once 'XML/Query2XML/Callback.php'; require_once dirname(dirname(__FILE__)) . '/db_init.php'; class RowTagGenerator implements XML_Query2XML_Callback { public function execute(array $record) { return $record['last_name']; } } $query2xml = XML_Query2XML::factory($db); $dom = $query2xml->getXML( "SELECT * FROM customer", array( 'rootTag' => 'customers', 'idColumn' => 'customerid', 'rowTag' => 'customer', 'elements' => array( 'customerid', 'name_and_email' => array( 'dynamicRowTag' => new RowTagGenerator(), 'value' => 'email' ) ) ) ); header('Content-Type: application/xml'); $dom->formatOutput = true; print $dom->saveXML(); ?> --EXPECT-- <?xml version="1.0" encoding="UTF-8"?> <customers> <customer> <customerid>1</customerid> <Doe>jane.doe@example.com</Doe> </customer> <customer> <customerid>2</customerid> <Doe>john.doe@example.com</Doe> </customer> <customer> <customerid>3</customerid> <Green>susan.green@example.com</Green> </customer> <customer> <customerid>4</customerid> <Alt>victory.alt@example.com</Alt> </customer> <customer> <customerid>5</customerid> <Rippy>will.wippy@example.com</Rippy> </customer> <customer> <customerid>6</customerid> <Raw>tim.raw@example.com</Raw> </customer> <customer> <customerid>7</customerid> <Fallow>nick.fallow@example.com</Fallow> </customer> <customer> <customerid>8</customerid> <Burton>ed.burton@example.com</Burton> </customer> <customer> <customerid>9</customerid> <Woo>jack.woo@example.com</Woo> </customer> <customer> <customerid>10</customerid> <Gonzales>maria.gonzales@example.com</Gonzales> </customer> </customers> http://cvs.php.net/viewvc.cgi/pear/XML_Query2XML/tests/XML_Query2XML/ADOdbException/getXML/dynamicRowTag_staticString.phpt?view=markup&rev=1.1 Index: pear/XML_Query2XML/tests/XML_Query2XML/ADOdbException/getXML/dynamicRowTag_staticString.phpt +++ pear/XML_Query2XML/tests/XML_Query2XML/ADOdbException/getXML/dynamicRowTag_staticString.phpt --TEST-- XML_Query2XML::getXML(): dynamicRowTag: static string --SKIPIF-- <?php require_once dirname(dirname(__FILE__)) . '/skipif.php'; ?> --FILE-- <?php require_once 'XML/Query2XML.php'; require_once dirname(dirname(__FILE__)) . '/db_init.php'; $query2xml = XML_Query2XML::factory($db); $dom = $query2xml->getXML( "SELECT * FROM customer", array( 'rootTag' => 'customers', 'idColumn' => 'customerid', 'rowTag' => 'customer', 'elements' => array( 'customerid', 'name_and_email' => array( 'dynamicRowTag' => ':email', 'value' => 'email' ) ) ) ); header('Content-Type: application/xml'); $dom->formatOutput = true; print $dom->saveXML(); ?> --EXPECT-- <?xml version="1.0" encoding="UTF-8"?> <customers> <customer> <customerid>1</customerid> <email>jane.doe@example.com</email> </customer> <customer> <customerid>2</customerid> <email>john.doe@example.com</email> </customer> <customer> <customerid>3</customerid> <email>susan.green@example.com</email> </customer> <customer> <customerid>4</customerid> <email>victory.alt@example.com</email> </customer> <customer> <customerid>5</customerid> <email>will.wippy@example.com</email> </customer> <customer> <customerid>6</customerid> <email>tim.raw@example.com</email> </customer> <customer> <customerid>7</customerid> <email>nick.fallow@example.com</email> </customer> <customer> <customerid>8</customerid> <email>ed.burton@example.com</email> </customer> <customer> <customerid>9</customerid> <email>jack.woo@example.com</email> </customer> <customer> <customerid>10</customerid> <email>maria.gonzales@example.com</email> </customer> </customers> http://cvs.php.net/viewvc.cgi/pear/XML_Query2XML/tests/XML_Query2XML/ADOdbPEAR/getXML/dynamicRowTag_callback.phpt?view=markup&rev=1.1 Index: pear/XML_Query2XML/tests/XML_Query2XML/ADOdbPEAR/getXML/dynamicRowTag_callback.phpt +++ pear/XML_Query2XML/tests/XML_Query2XML/ADOdbPEAR/getXML/dynamicRowTag_callback.phpt --TEST-- XML_Query2XML::getXML(): dynamicRowTag: callback function --SKIPIF-- <?php require_once dirname(dirname(__FILE__)) . '/skipif.php'; ?> --FILE-- <?php function getRowTagName($record) { return $record['last_name']; } require_once 'XML/Query2XML.php'; require_once dirname(dirname(__FILE__)) . '/db_init.php'; $query2xml = XML_Query2XML::factory($db); $dom = $query2xml->getXML( "SELECT * FROM customer", array( 'rootTag' => 'customers', 'idColumn' => 'customerid', 'rowTag' => 'customer', 'elements' => array( 'customerid', 'name_and_email' => array( 'dynamicRowTag' => '#getRowTagName', 'value' => 'email' ) ) ) ); header('Content-Type: application/xml'); $dom->formatOutput = true; print $dom->saveXML(); ?> --EXPECT-- <?xml version="1.0" encoding="UTF-8"?> <customers> <customer> <customerid>1</customerid> <Doe>jane.doe@example.com</Doe> </customer> <customer> <customerid>2</customerid> <Doe>john.doe@example.com</Doe> </customer> <customer> <customerid>3</customerid> <Green>susan.green@example.com</Green> </customer> <customer> <customerid>4</customerid> <Alt>victory.alt@example.com</Alt> </customer> <customer> <customerid>5</customerid> <Rippy>will.wippy@example.com</Rippy> </customer> <customer> <customerid>6</customerid> <Raw>tim.raw@example.com</Raw> </customer> <customer> <customerid>7</customerid> <Fallow>nick.fallow@example.com</Fallow> </customer> <customer> <customerid>8</customerid> <Burton>ed.burton@example.com</Burton> </customer> <customer> <customerid>9</customerid> <Woo>jack.woo@example.com</Woo> </customer> <customer> <customerid>10</customerid> <Gonzales>maria.gonzales@example.com</Gonzales> </customer> </customers> http://cvs.php.net/viewvc.cgi/pear/XML_Query2XML/tests/XML_Query2XML/ADOdbPEAR/getXML/dynamicRowTag_columnName.phpt?view=markup&rev=1.1 Index: pear/XML_Query2XML/tests/XML_Query2XML/ADOdbPEAR/getXML/dynamicRowTag_columnName.phpt +++ pear/XML_Query2XML/tests/XML_Query2XML/ADOdbPEAR/getXML/dynamicRowTag_columnName.phpt --TEST-- XML_Query2XML::getXML(): dynamicRowTag: COLUMN NAME --SKIPIF-- <?php require_once dirname(dirname(__FILE__)) . '/skipif.php'; ?> --FILE-- <?php require_once 'XML/Query2XML.php'; require_once dirname(dirname(__FILE__)) . '/db_init.php'; $query2xml = XML_Query2XML::factory($db); $dom = $query2xml->getXML( "SELECT * FROM customer", array( 'rootTag' => 'customers', 'idColumn' => 'customerid', 'rowTag' => 'customer', 'elements' => array( 'customerid', 'name_and_email' => array( 'dynamicRowTag' => 'first_name', 'value' => 'email' ) ) ) ); header('Content-Type: application/xml'); $dom->formatOutput = true; print $dom->saveXML(); ?> --EXPECT-- <?xml version="1.0" encoding="UTF-8"?> <customers> <customer> <customerid>1</customerid> <Jane>jane.doe@example.com</Jane> </customer> <customer> <customerid>2</customerid> <John>john.doe@example.com</John> </customer> <customer> <customerid>3</customerid> <Susan>susan.green@example.com</Susan> </customer> <customer> <customerid>4</customerid> <Victoria>victory.alt@example.com</Victoria> </customer> <customer> <customerid>5</customerid> <Will>will.wippy@example.com</Will> </customer> <customer> <customerid>6</customerid> <Tim>tim.raw@example.com</Tim> </customer> <customer> <customerid>7</customerid> <Nick>nick.fallow@example.com</Nick> </customer> <customer> <customerid>8</customerid> <Ed>ed.burton@example.com</Ed> </customer> <customer> <customerid>9</customerid> <Jack>jack.woo@example.com</Jack> </customer> <customer> <customerid>10</customerid> <Maria>maria.gonzales@example.com</Maria> </customer> </customers> http://cvs.php.net/viewvc.cgi/pear/XML_Query2XML/tests/XML_Query2XML/ADOdbPEAR/getXML/dynamicRowTag_columnName_ignoreRowTag.phpt?view=markup&rev=1.1 Index: pear/XML_Query2XML/tests/XML_Query2XML/ADOdbPEAR/getXML/dynamicRowTag_columnName_ignoreRowTag.phpt +++ pear/XML_Query2XML/tests/XML_Query2XML/ADOdbPEAR/getXML/dynamicRowTag_columnName_ignoreRowTag.phpt --TEST-- XML_Query2XML::getXML(): dynamicRowTag: ignoring $options['rowTag'] --SKIPIF-- <?php require_once dirname(dirname(__FILE__)) . '/skipif.php'; ?> --FILE-- <?php require_once 'XML/Query2XML.php'; require_once dirname(dirname(__FILE__)) . '/db_init.php'; $query2xml = XML_Query2XML::factory($db); $dom = $query2xml->getXML( "SELECT * FROM customer", array( 'rootTag' => 'customers', 'idColumn' => 'customerid', 'rowTag' => 'customer', 'elements' => array( 'customerid', 'name_and_email' => array( 'rowTag' => 'ignore_me', 'dynamicRowTag' => 'first_name', 'value' => 'email' ) ) ) ); header('Content-Type: application/xml'); $dom->formatOutput = true; print $dom->saveXML(); ?> --EXPECT-- <?xml version="1.0" encoding="UTF-8"?> <customers> <customer> <customerid>1</customerid> <Jane>jane.doe@example.com</Jane> </customer> <customer> <customerid>2</customerid> <John>john.doe@example.com</John> </customer> <customer> <customerid>3</customerid> <Susan>susan.green@example.com</Susan> </customer> <customer> <customerid>4</customerid> <Victoria>victory.alt@example.com</Victoria> </customer> <customer> <customerid>5</customerid> <Will>will.wippy@example.com</Will> </customer> <customer> <customerid>6</customerid> <Tim>tim.raw@example.com</Tim> </customer> <customer> <customerid>7</customerid> <Nick>nick.fallow@example.com</Nick> </customer> <customer> <customerid>8</customerid> <Ed>ed.burton@example.com</Ed> </customer> <customer> <customerid>9</customerid> <Jack>jack.woo@example.com</Jack> </customer> <customer> <customerid>10</customerid> <Maria>maria.gonzales@example.com</Maria> </customer> </customers> http://cvs.php.net/viewvc.cgi/pear/XML_Query2XML/tests/XML_Query2XML/ADOdbPEAR/getXML/dynamicRowTag_columnName_onRootLevel.phpt?view=markup&rev=1.1 Index: pear/XML_Query2XML/tests/XML_Query2XML/ADOdbPEAR/getXML/dynamicRowTag_columnName_onRootLevel.phpt +++ pear/XML_Query2XML/tests/XML_Query2XML/ADOdbPEAR/getXML/dynamicRowTag_columnName_onRootLevel.phpt --TEST-- XML_Query2XML::getXML(): dynamicRowTag: COLUMN NAME on root level --SKIPIF-- <?php require_once dirname(dirname(__FILE__)) . '/skipif.php'; ?> --FILE-- <?php require_once 'XML/Query2XML.php'; require_once dirname(dirname(__FILE__)) . '/db_init.php'; $query2xml = XML_Query2XML::factory($db); $dom = $query2xml->getXML( "SELECT * FROM customer", array( 'rootTag' => 'customers', 'idColumn' => 'customerid', 'dynamicRowTag' => 'first_name', 'value' => 'email' ) ); header('Content-Type: application/xml'); $dom->formatOutput = true; print $dom->saveXML(); ?> --EXPECT-- <?xml version="1.0" encoding="UTF-8"?> <customers> <Jane>jane.doe@example.com</Jane> <John>john.doe@example.com</John> <Susan>susan.green@example.com</Susan> <Victoria>victory.alt@example.com</Victoria> <Will>will.wippy@example.com</Will> <Tim>tim.raw@example.com</Tim> <Nick>nick.fallow@example.com</Nick> <Ed>ed.burton@example.com</Ed> <Jack>jack.woo@example.com</Jack> <Maria>maria.gonzales@example.com</Maria> </customers> http://cvs.php.net/viewvc.cgi/pear/XML_Query2XML/tests/XML_Query2XML/ADOdbPEAR/getXML/dynamicRowTag_commandObject.phpt?view=markup&rev=1.1 Index: pear/XML_Query2XML/tests/XML_Query2XML/ADOdbPEAR/getXML/dynamicRowTag_commandObject.phpt +++ pear/XML_Query2XML/tests/XML_Query2XML/ADOdbPEAR/getXML/dynamicRowTag_commandObject.phpt --TEST-- XML_Query2XML::getXML(): dynamicRowTag: COMMAND OBJECT --SKIPIF-- <?php require_once dirname(dirname(__FILE__)) . '/skipif.php'; ?> --FILE-- <?php require_once 'XML/Query2XML.php'; require_once 'XML/Query2XML/Callback.php'; require_once dirname(dirname(__FILE__)) . '/db_init.php'; class RowTagGenerator implements XML_Query2XML_Callback { public function execute(array $record) { return $record['last_name']; } } $query2xml = XML_Query2XML::factory($db); $dom = $query2xml->getXML( "SELECT * FROM customer", array( 'rootTag' => 'customers', 'idColumn' => 'customerid', 'rowTag' => 'customer', 'elements' => array( 'customerid', 'name_and_email' => array( 'dynamicRowTag' => new RowTagGenerator(), 'value' => 'email' ) ) ) ); header('Content-Type: application/xml'); $dom->formatOutput = true; print $dom->saveXML(); ?> --EXPECT-- <?xml version="1.0" encoding="UTF-8"?> <customers> <customer> <customerid>1</customerid> <Doe>jane.doe@example.com</Doe> </customer> <customer> <customerid>2</customerid> <Doe>john.doe@example.com</Doe> </customer> <customer> <customerid>3</customerid> <Green>susan.green@example.com</Green> </customer> <customer> <customerid>4</customerid> <Alt>victory.alt@example.com</Alt> </customer> <customer> <customerid>5</customerid> <Rippy>will.wippy@example.com</Rippy> </customer> <customer> <customerid>6</customerid> <Raw>tim.raw@example.com</Raw> </customer> <customer> <customerid>7</customerid> <Fallow>nick.fallow@example.com</Fallow> </customer> <customer> <customerid>8</customerid> <Burton>ed.burton@example.com</Burton> </customer> <customer> <customerid>9</customerid> <Woo>jack.woo@example.com</Woo> </customer> <customer> <customerid>10</customerid> <Gonzales>maria.gonzales@example.com</Gonzales> </customer> </customers> http://cvs.php.net/viewvc.cgi/pear/XML_Query2XML/tests/XML_Query2XML/ADOdbPEAR/getXML/dynamicRowTag_staticString.phpt?view=markup&rev=1.1 Index: pear/XML_Query2XML/tests/XML_Query2XML/ADOdbPEAR/getXML/dynamicRowTag_staticString.phpt +++ pear/XML_Query2XML/tests/XML_Query2XML/ADOdbPEAR/getXML/dynamicRowTag_staticString.phpt --TEST-- XML_Query2XML::getXML(): dynamicRowTag: static string --SKIPIF-- <?php require_once dirname(dirname(__FILE__)) . '/skipif.php'; ?> --FILE-- <?php require_once 'XML/Query2XML.php'; require_once dirname(dirname(__FILE__)) . '/db_init.php'; $query2xml = XML_Query2XML::factory($db); $dom = $query2xml->getXML( "SELECT * FROM customer", array( 'rootTag' => 'customers', 'idColumn' => 'customerid', 'rowTag' => 'customer', 'elements' => array( 'customerid', 'name_and_email' => array( 'dynamicRowTag' => ':email', 'value' => 'email' ) ) ) ); header('Content-Type: application/xml'); $dom->formatOutput = true; print $dom->saveXML(); ?> --EXPECT-- <?xml version="1.0" encoding="UTF-8"?> <customers> <customer> <customerid>1</customerid> <email>jane.doe@example.com</email> </customer> <customer> <customerid>2</customerid> <email>john.doe@example.com</email> </customer> <customer> <customerid>3</customerid> <email>susan.green@example.com</email> </customer> <customer> <customerid>4</customerid> <email>victory.alt@example.com</email> </customer> <customer> <customerid>5</customerid> <email>will.wippy@example.com</email> </customer> <customer> <customerid>6</customerid> <email>tim.raw@example.com</email> </customer> <customer> <customerid>7</customerid> <email>nick.fallow@example.com</email> </customer> <customer> <customerid>8</customerid> <email>ed.burton@example.com</email> </customer> <customer> <customerid>9</customerid> <email>jack.woo@example.com</email> </customer> <customer> <customerid>10</customerid> <email>maria.gonzales@example.com</email> </customer> </customers> http://cvs.php.net/viewvc.cgi/pear/XML_Query2XML/tests/XML_Query2XML/DB/getXML/dynamicRowTag_callback.phpt?view=markup&rev=1.1 Index: pear/XML_Query2XML/tests/XML_Query2XML/DB/getXML/dynamicRowTag_callback.phpt +++ pear/XML_Query2XML/tests/XML_Query2XML/DB/getXML/dynamicRowTag_callback.phpt --TEST-- XML_Query2XML::getXML(): dynamicRowTag: callback function --SKIPIF-- <?php require_once dirname(dirname(__FILE__)) . '/skipif.php'; ?> --FILE-- <?php function getRowTagName($record) { return $record['last_name']; } require_once 'XML/Query2XML.php'; require_once dirname(dirname(__FILE__)) . '/db_init.php'; $query2xml = XML_Query2XML::factory($db); $dom = $query2xml->getXML( "SELECT * FROM customer", array( 'rootTag' => 'customers', 'idColumn' => 'customerid', 'rowTag' => 'customer', 'elements' => array( 'customerid', 'name_and_email' => array( 'dynamicRowTag' => '#getRowTagName', 'value' => 'email' ) ) ) ); header('Content-Type: application/xml'); $dom->formatOutput = true; print $dom->saveXML(); ?> --EXPECT-- <?xml version="1.0" encoding="UTF-8"?> <customers> <customer> <customerid>1</customerid> <Doe>jane.doe@example.com</Doe> </customer> <customer> <customerid>2</customerid> <Doe>john.doe@example.com</Doe> </customer> <customer> <customerid>3</customerid> <Green>susan.green@example.com</Green> </customer> <customer> <customerid>4</customerid> <Alt>victory.alt@example.com</Alt> </customer> <customer> <customerid>5</customerid> <Rippy>will.wippy@example.com</Rippy> </customer> <customer> <customerid>6</customerid> <Raw>tim.raw@example.com</Raw> </customer> <customer> <customerid>7</customerid> <Fallow>nick.fallow@example.com</Fallow> </customer> <customer> <customerid>8</customerid> <Burton>ed.burton@example.com</Burton> </customer> <customer> <customerid>9</customerid> <Woo>jack.woo@example.com</Woo> </customer> <customer> <customerid>10</customerid> <Gonzales>maria.gonzales@example.com</Gonzales> </customer> </customers> http://cvs.php.net/viewvc.cgi/pear/XML_Query2XML/tests/XML_Query2XML/DB/getXML/dynamicRowTag_columnName.phpt?view=markup&rev=1.1 Index: pear/XML_Query2XML/tests/XML_Query2XML/DB/getXML/dynamicRowTag_columnName.phpt +++ pear/XML_Query2XML/tests/XML_Query2XML/DB/getXML/dynamicRowTag_columnName.phpt --TEST-- XML_Query2XML::getXML(): dynamicRowTag: COLUMN NAME --SKIPIF-- <?php require_once dirname(dirname(__FILE__)) . '/skipif.php'; ?> --FILE-- <?php require_once 'XML/Query2XML.php'; require_once dirname(dirname(__FILE__)) . '/db_init.php'; $query2xml = XML_Query2XML::factory($db); $dom = $query2xml->getXML( "SELECT * FROM customer", array( 'rootTag' => 'customers', 'idColumn' => 'customerid', 'rowTag' => 'customer', 'elements' => array( 'customerid', 'name_and_email' => array( 'dynamicRowTag' => 'first_name', 'value' => 'email' ) ) ) ); header('Content-Type: application/xml'); $dom->formatOutput = true; print $dom->saveXML(); ?> --EXPECT-- <?xml version="1.0" encoding="UTF-8"?> <customers> <customer> <customerid>1</customerid> <Jane>jane.doe@example.com</Jane> </customer> <customer> <customerid>2</customerid> <John>john.doe@example.com</John> </customer> <customer> <customerid>3</customerid> <Susan>susan.green@example.com</Susan> </customer> <customer> <customerid>4</customerid> <Victoria>victory.alt@example.com</Victoria> </customer> <customer> <customerid>5</customerid> <Will>will.wippy@example.com</Will> </customer> <customer> <customerid>6</customerid> <Tim>tim.raw@example.com</Tim> </customer> <customer> <customerid>7</customerid> <Nick>nick.fallow@example.com</Nick> </customer> <customer> <customerid>8</customerid> <Ed>ed.burton@example.com</Ed> </customer> <customer> <customerid>9</customerid> <Jack>jack.woo@example.com</Jack> </customer> <customer> <customerid>10</customerid> <Maria>maria.gonzales@example.com</Maria> </customer> </customers> http://cvs.php.net/viewvc.cgi/pear/XML_Query2XML/tests/XML_Query2XML/DB/getXML/dynamicRowTag_columnName_ignoreRowTag.phpt?view=markup&rev=1.1 Index: pear/XML_Query2XML/tests/XML_Query2XML/DB/getXML/dynamicRowTag_columnName_ignoreRowTag.phpt +++ pear/XML_Query2XML/tests/XML_Query2XML/DB/getXML/dynamicRowTag_columnName_ignoreRowTag.phpt --TEST-- XML_Query2XML::getXML(): dynamicRowTag: ignoring $options['rowTag'] --SKIPIF-- <?php require_once dirname(dirname(__FILE__)) . '/skipif.php'; ?> --FILE-- <?php require_once 'XML/Query2XML.php'; require_once dirname(dirname(__FILE__)) . '/db_init.php'; $query2xml = XML_Query2XML::factory($db); $dom = $query2xml->getXML( "SELECT * FROM customer", array( 'rootTag' => 'customers', 'idColumn' => 'customerid', 'rowTag' => 'customer', 'elements' => array( 'customerid', 'name_and_email' => array( 'rowTag' => 'ignore_me', 'dynamicRowTag' => 'first_name', 'value' => 'email' ) ) ) ); header('Content-Type: application/xml'); $dom->formatOutput = true; print $dom->saveXML(); ?> --EXPECT-- <?xml version="1.0" encoding="UTF-8"?> <customers> <customer> <customerid>1</customerid> <Jane>jane.doe@example.com</Jane> </customer> <customer> <customerid>2</customerid> <John>john.doe@example.com</John> </customer> <customer> <customerid>3</customerid> <Susan>susan.green@example.com</Susan> </customer> <customer> <customerid>4</customerid> <Victoria>victory.alt@example.com</Victoria> </customer> <customer> <customerid>5</customerid> <Will>will.wippy@example.com</Will> </customer> <customer> <customerid>6</customerid> <Tim>tim.raw@example.com</Tim> </customer> <customer> <customerid>7</customerid> <Nick>nick.fallow@example.com</Nick> </customer> <customer> <customerid>8</customerid> <Ed>ed.burton@example.com</Ed> </customer> <customer> <customerid>9</customerid> <Jack>jack.woo@example.com</Jack> </customer> <customer> <customerid>10</customerid> <Maria>maria.gonzales@example.com</Maria> </customer> </customers> http://cvs.php.net/viewvc.cgi/pear/XML_Query2XML/tests/XML_Query2XML/DB/getXML/dynamicRowTag_columnName_onRootLevel.phpt?view=markup&rev=1.1 Index: pear/XML_Query2XML/tests/XML_Query2XML/DB/getXML/dynamicRowTag_columnName_onRootLevel.phpt +++ pear/XML_Query2XML/tests/XML_Query2XML/DB/getXML/dynamicRowTag_columnName_onRootLevel.phpt --TEST-- XML_Query2XML::getXML(): dynamicRowTag: COLUMN NAME on root level --SKIPIF-- <?php require_once dirname(dirname(__FILE__)) . '/skipif.php'; ?> --FILE-- <?php require_once 'XML/Query2XML.php'; require_once dirname(dirname(__FILE__)) . '/db_init.php'; $query2xml = XML_Query2XML::factory($db); $dom = $query2xml->getXML( "SELECT * FROM customer", array( 'rootTag' => 'customers', 'idColumn' => 'customerid', 'dynamicRowTag' => 'first_name', 'value' => 'email' ) ); header('Content-Type: application/xml'); $dom->formatOutput = true; print $dom->saveXML(); ?> --EXPECT-- <?xml version="1.0" encoding="UTF-8"?> <customers> <Jane>jane.doe@example.com</Jane> <John>john.doe@example.com</John> <Susan>susan.green@example.com</Susan> <Victoria>victory.alt@example.com</Victoria> <Will>will.wippy@example.com</Will> <Tim>tim.raw@example.com</Tim> <Nick>nick.fallow@example.com</Nick> <Ed>ed.burton@example.com</Ed> <Jack>jack.woo@example.com</Jack> <Maria>maria.gonzales@example.com</Maria> </customers> http://cvs.php.net/viewvc.cgi/pear/XML_Query2XML/tests/XML_Query2XML/DB/getXML/dynamicRowTag_commandObject.phpt?view=markup&rev=1.1 Index: pear/XML_Query2XML/tests/XML_Query2XML/DB/getXML/dynamicRowTag_commandObject.phpt +++ pear/XML_Query2XML/tests/XML_Query2XML/DB/getXML/dynamicRowTag_commandObject.phpt --TEST-- XML_Query2XML::getXML(): dynamicRowTag: COMMAND OBJECT --SKIPIF-- <?php require_once dirname(dirname(__FILE__)) . '/skipif.php'; ?> --FILE-- <?php require_once 'XML/Query2XML.php'; require_once 'XML/Query2XML/Callback.php'; require_once dirname(dirname(__FILE__)) . '/db_init.php'; class RowTagGenerator implements XML_Query2XML_Callback { public function execute(array $record) { return $record['last_name']; } } $query2xml = XML_Query2XML::factory($db); $dom = $query2xml->getXML( "SELECT * FROM customer", array( 'rootTag' => 'customers', 'idColumn' => 'customerid', 'rowTag' => 'customer', 'elements' => array( 'customerid', 'name_and_email' => array( 'dynamicRowTag' => new RowTagGenerator(), 'value' => 'email' ) ) ) ); header('Content-Type: application/xml'); $dom->formatOutput = true; print $dom->saveXML(); ?> --EXPECT-- <?xml version="1.0" encoding="UTF-8"?> <customers> <customer> <customerid>1</customerid> <Doe>jane.doe@example.com</Doe> </customer> <customer> <customerid>2</customerid> <Doe>john.doe@example.com</Doe> </customer> <customer> <customerid>3</customerid> <Green>susan.green@example.com</Green> </customer> <customer> <customerid>4</customerid> <Alt>victory.alt@example.com</Alt> </customer> <customer> <customerid>5</customerid> <Rippy>will.wippy@example.com</Rippy> </customer> <customer> <customerid>6</customerid> <Raw>tim.raw@example.com</Raw> </customer> <customer> <customerid>7</customerid> <Fallow>nick.fallow@example.com</Fallow> </customer> <customer> <customerid>8</customerid> <Burton>ed.burton@example.com</Burton> </customer> <customer> <customerid>9</customerid> <Woo>jack.woo@example.com</Woo> </customer> <customer> <customerid>10</customerid> <Gonzales>maria.gonzales@example.com</Gonzales> </customer> </customers> http://cvs.php.net/viewvc.cgi/pear/XML_Query2XML/tests/XML_Query2XML/DB/getXML/dynamicRowTag_staticString.phpt?view=markup&rev=1.1 Index: pear/XML_Query2XML/tests/XML_Query2XML/DB/getXML/dynamicRowTag_staticString.phpt +++ pear/XML_Query2XML/tests/XML_Query2XML/DB/getXML/dynamicRowTag_staticString.phpt --TEST-- XML_Query2XML::getXML(): dynamicRowTag: static string --SKIPIF-- <?php require_once dirname(dirname(__FILE__)) . '/skipif.php'; ?> --FILE-- <?php require_once 'XML/Query2XML.php'; require_once dirname(dirname(__FILE__)) . '/db_init.php'; $query2xml = XML_Query2XML::factory($db); $dom = $query2xml->getXML( "SELECT * FROM customer", array( 'rootTag' => 'customers', 'idColumn' => 'customerid', 'rowTag' => 'customer', 'elements' => array( 'customerid', 'name_and_email' => array( 'dynamicRowTag' => ':email', 'value' => 'email' ) ) ) ); header('Content-Type: application/xml'); $dom->formatOutput = true; print $dom->saveXML(); ?> --EXPECT-- <?xml version="1.0" encoding="UTF-8"?> <customers> <customer> <customerid>1</customerid> <email>jane.doe@example.com</email> </customer> <customer> <customerid>2</customerid> <email>john.doe@example.com</email> </customer> <customer> <customerid>3</customerid> <email>susan.green@example.com</email> </customer> <customer> <customerid>4</customerid> <email>victory.alt@example.com</email> </customer> <customer> <customerid>5</customerid> <email>will.wippy@example.com</email> </customer> <customer> <customerid>6</customerid> <email>tim.raw@example.com</email> </customer> <customer> <customerid>7</customerid> <email>nick.fallow@example.com</email> </customer> <customer> <customerid>8</customerid> <email>ed.burton@example.com</email> </customer> <customer> <customerid>9</customerid> <email>jack.woo@example.com</email> </customer> <customer> <customerid>10</customerid> <email>maria.gonzales@example.com</email> </customer> </customers> http://cvs.php.net/viewvc.cgi/pear/XML_Query2XML/tests/XML_Query2XML/MDB2/getXML/dynamicRowTag_callback.phpt?view=markup&rev=1.1 Index: pear/XML_Query2XML/tests/XML_Query2XML/MDB2/getXML/dynamicRowTag_callback.phpt +++ pear/XML_Query2XML/tests/XML_Query2XML/MDB2/getXML/dynamicRowTag_callback.phpt --TEST-- XML_Query2XML::getXML(): dynamicRowTag: callback function --SKIPIF-- <?php require_once dirname(dirname(__FILE__)) . '/skipif.php'; ?> --FILE-- <?php function getRowTagName($record) { return $record['last_name']; } require_once 'XML/Query2XML.php'; require_once dirname(dirname(__FILE__)) . '/db_init.php'; $query2xml = XML_Query2XML::factory($db); $dom = $query2xml->getXML( "SELECT * FROM customer", array( 'rootTag' => 'customers', 'idColumn' => 'customerid', 'rowTag' => 'customer', 'elements' => array( 'customerid', 'name_and_email' => array( 'dynamicRowTag' => '#getRowTagName', 'value' => 'email' ) ) ) ); header('Content-Type: application/xml'); $dom->formatOutput = true; print $dom->saveXML(); ?> --EXPECT-- <?xml version="1.0" encoding="UTF-8"?> <customers> <customer> <customerid>1</customerid> <Doe>jane.doe@example.com</Doe> </customer> <customer> <customerid>2</customerid> <Doe>john.doe@example.com</Doe> </customer> <customer> <customerid>3</customerid> <Green>susan.green@example.com</Green> </customer> <customer> <customerid>4</customerid> <Alt>victory.alt@example.com</Alt> </customer> <customer> <customerid>5</customerid> <Rippy>will.wippy@example.com</Rippy> </customer> <customer> <customerid>6</customerid> <Raw>tim.raw@example.com</Raw> </customer> <customer> <customerid>7</customerid> <Fallow>nick.fallow@example.com</Fallow> </customer> <customer> <customerid>8</customerid> <Burton>ed.burton@example.com</Burton> </customer> <customer> <customerid>9</customerid> <Woo>jack.woo@example.com</Woo> </customer> <customer> <customerid>10</customerid> <Gonzales>maria.gonzales@example.com</Gonzales> </customer> </customers> http://cvs.php.net/viewvc.cgi/pear/XML_Query2XML/tests/XML_Query2XML/MDB2/getXML/dynamicRowTag_columnName.phpt?view=markup&rev=1.1 Index: pear/XML_Query2XML/tests/XML_Query2XML/MDB2/getXML/dynamicRowTag_columnName.phpt +++ pear/XML_Query2XML/tests/XML_Query2XML/MDB2/getXML/dynamicRowTag_columnName.phpt --TEST-- XML_Query2XML::getXML(): dynamicRowTag: COLUMN NAME --SKIPIF-- <?php require_once dirname(dirname(__FILE__)) . '/skipif.php'; ?> --FILE-- <?php require_once 'XML/Query2XML.php'; require_once dirname(dirname(__FILE__)) . '/db_init.php'; $query2xml = XML_Query2XML::factory($db); $dom = $query2xml->getXML( "SELECT * FROM customer", array( 'rootTag' => 'customers', 'idColumn' => 'customerid', 'rowTag' => 'customer', 'elements' => array( 'customerid', 'name_and_email' => array( 'dynamicRowTag' => 'first_name', 'value' => 'email' ) ) ) ); header('Content-Type: application/xml'); $dom->formatOutput = true; print $dom->saveXML(); ?> --EXPECT-- <?xml version="1.0" encoding="UTF-8"?> <customers> <customer> <customerid>1</customerid> <Jane>jane.doe@example.com</Jane> </customer> <customer> <customerid>2</customerid> <John>john.doe@example.com</John> </customer> <customer> <customerid>3</customerid> <Susan>susan.green@example.com</Susan> </customer> <customer> <customerid>4</customerid> <Victoria>victory.alt@example.com</Victoria> </customer> <customer> <customerid>5</customerid> <Will>will.wippy@example.com</Will> </customer> <customer> <customerid>6</customerid> <Tim>tim.raw@example.com</Tim> </customer> <customer> <customerid>7</customerid> <Nick>nick.fallow@example.com</Nick> </customer> <customer> <customerid>8</customerid> <Ed>ed.burton@example.com</Ed> </customer> <customer> <customerid>9</customerid> <Jack>jack.woo@example.com</Jack> </customer> <customer> <customerid>10</customerid> <Maria>maria.gonzales@example.com</Maria> </customer> </customers> http://cvs.php.net/viewvc.cgi/pear/XML_Query2XML/tests/XML_Query2XML/MDB2/getXML/dynamicRowTag_columnName_ignoreRowTag.phpt?view=markup&rev=1.1 Index: pear/XML_Query2XML/tests/XML_Query2XML/MDB2/getXML/dynamicRowTag_columnName_ignoreRowTag.phpt +++ pear/XML_Query2XML/tests/XML_Query2XML/MDB2/getXML/dynamicRowTag_columnName_ignoreRowTag.phpt --TEST-- XML_Query2XML::getXML(): dynamicRowTag: ignoring $options['rowTag'] --SKIPIF-- <?php require_once dirname(dirname(__FILE__)) . '/skipif.php'; ?> --FILE-- <?php require_once 'XML/Query2XML.php'; require_once dirname(dirname(__FILE__)) . '/db_init.php'; $query2xml = XML_Query2XML::factory($db); $dom = $query2xml->getXML( "SELECT * FROM customer", array( 'rootTag' => 'customers', 'idColumn' => 'customerid', 'rowTag' => 'customer', 'elements' => array( 'customerid', 'name_and_email' => array( 'rowTag' => 'ignore_me', 'dynamicRowTag' => 'first_name', 'value' => 'email' ) ) ) ); header('Content-Type: application/xml'); $dom->formatOutput = true; print $dom->saveXML(); ?> --EXPECT-- <?xml version="1.0" encoding="UTF-8"?> <customers> <customer> <customerid>1</customerid> <Jane>jane.doe@example.com</Jane> </customer> <customer> <customerid>2</customerid> <John>john.doe@example.com</John> </customer> <customer> <customerid>3</customerid> <Susan>susan.green@example.com</Susan> </customer> <customer> <customerid>4</customerid> <Victoria>victory.alt@example.com</Victoria> </customer> <customer> <customerid>5</customerid> <Will>will.wippy@example.com</Will> </customer> <customer> <customerid>6</customerid> <Tim>tim.raw@example.com</Tim> </customer> <customer> <customerid>7</customerid> <Nick>nick.fallow@example.com</Nick> </customer> <customer> <customerid>8</customerid> <Ed>ed.burton@example.com</Ed> </customer> <customer> <customerid>9</customerid> <Jack>jack.woo@example.com</Jack> </customer> <customer> <customerid>10</customerid> <Maria>maria.gonzales@example.com</Maria> </customer> </customers> http://cvs.php.net/viewvc.cgi/pear/XML_Query2XML/tests/XML_Query2XML/MDB2/getXML/dynamicRowTag_columnName_onRootLevel.phpt?view=markup&rev=1.1 Index: pear/XML_Query2XML/tests/XML_Query2XML/MDB2/getXML/dynamicRowTag_columnName_onRootLevel.phpt +++ pear/XML_Query2XML/tests/XML_Query2XML/MDB2/getXML/dynamicRowTag_columnName_onRootLevel.phpt --TEST-- XML_Query2XML::getXML(): dynamicRowTag: COLUMN NAME on root level --SKIPIF-- <?php require_once dirname(dirname(__FILE__)) . '/skipif.php'; ?> --FILE-- <?php require_once 'XML/Query2XML.php'; require_once dirname(dirname(__FILE__)) . '/db_init.php'; $query2xml = XML_Query2XML::factory($db); $dom = $query2xml->getXML( "SELECT * FROM customer", array( 'rootTag' => 'customers', 'idColumn' => 'customerid', 'dynamicRowTag' => 'first_name', 'value' => 'email' ) ); header('Content-Type: application/xml'); $dom->formatOutput = true; print $dom->saveXML(); ?> --EXPECT-- <?xml version="1.0" encoding="UTF-8"?> <customers> <Jane>jane.doe@example.com</Jane> <John>john.doe@example.com</John> <Susan>susan.green@example.com</Susan> <Victoria>victory.alt@example.com</Victoria> <Will>will.wippy@example.com</Will> <Tim>tim.raw@example.com</Tim> <Nick>nick.fallow@example.com</Nick> <Ed>ed.burton@example.com</Ed> <Jack>jack.woo@example.com</Jack> <Maria>maria.gonzales@example.com</Maria> </customers> http://cvs.php.net/viewvc.cgi/pear/XML_Query2XML/tests/XML_Query2XML/MDB2/getXML/dynamicRowTag_commandObject.phpt?view=markup&rev=1.1 Index: pear/XML_Query2XML/tests/XML_Query2XML/MDB2/getXML/dynamicRowTag_commandObject.phpt +++ pear/XML_Query2XML/tests/XML_Query2XML/MDB2/getXML/dynamicRowTag_commandObject.phpt --TEST-- XML_Query2XML::getXML(): dynamicRowTag: COMMAND OBJECT --SKIPIF-- <?php require_once dirname(dirname(__FILE__)) . '/skipif.php'; ?> --FILE-- <?php require_once 'XML/Query2XML.php'; require_once 'XML/Query2XML/Callback.php'; require_once dirname(dirname(__FILE__)) . '/db_init.php'; class RowTagGenerator implements XML_Query2XML_Callback { public function execute(array $record) { return $record['last_name']; } } $query2xml = XML_Query2XML::factory($db); $dom = $query2xml->getXML( "SELECT * FROM customer", array( 'rootTag' => 'customers', 'idColumn' => 'customerid', 'rowTag' => 'customer', 'elements' => array( 'customerid', 'name_and_email' => array( 'dynamicRowTag' => new RowTagGenerator(), 'value' => 'email' ) ) ) ); header('Content-Type: application/xml'); $dom->formatOutput = true; print $dom->saveXML(); ?> --EXPECT-- <?xml version="1.0" encoding="UTF-8"?> <customers> <customer> <customerid>1</customerid> <Doe>jane.doe@example.com</Doe> </customer> <customer> <customerid>2</customerid> <Doe>john.doe@example.com</Doe> </customer> <customer> <customerid>3</customerid> <Green>susan.green@example.com</Green> </customer> <customer> <customerid>4</customerid> <Alt>victory.alt@example.com</Alt> </customer> <customer> <customerid>5</customerid> <Rippy>will.wippy@example.com</Rippy> </customer> <customer> <customerid>6</customerid> <Raw>tim.raw@example.com</Raw> </customer> <customer> <customerid>7</customerid> <Fallow>nick.fallow@example.com</Fallow> </customer> <customer> <customerid>8</customerid> <Burton>ed.burton@example.com</Burton> </customer> <customer> <customerid>9</customerid> <Woo>jack.woo@example.com</Woo> </customer> <customer> <customerid>10</customerid> <Gonzales>maria.gonzales@example.com</Gonzales> </customer> </customers> http://cvs.php.net/viewvc.cgi/pear/XML_Query2XML/tests/XML_Query2XML/MDB2/getXML/dynamicRowTag_staticString.phpt?view=markup&rev=1.1 Index: pear/XML_Query2XML/tests/XML_Query2XML/MDB2/getXML/dynamicRowTag_staticString.phpt +++ pear/XML_Query2XML/tests/XML_Query2XML/MDB2/getXML/dynamicRowTag_staticString.phpt --TEST-- XML_Query2XML::getXML(): dynamicRowTag: static string --SKIPIF-- <?php require_once dirname(dirname(__FILE__)) . '/skipif.php'; ?> --FILE-- <?php require_once 'XML/Query2XML.php'; require_once dirname(dirname(__FILE__)) . '/db_init.php'; $query2xml = XML_Query2XML::factory($db); $dom = $query2xml->getXML( "SELECT * FROM customer", array( 'rootTag' => 'customers', 'idColumn' => 'customerid', 'rowTag' => 'customer', 'elements' => array( 'customerid', 'name_and_email' => array( 'dynamicRowTag' => ':email', 'value' => 'email' ) ) ) ); header('Content-Type: application/xml'); $dom->formatOutput = true; print $dom->saveXML(); ?> --EXPECT-- <?xml version="1.0" encoding="UTF-8"?> <customers> <customer> <customerid>1</customerid> <email>jane.doe@example.com</email> </customer> <customer> <customerid>2</customerid> <email>john.doe@example.com</email> </customer> <customer> <customerid>3</customerid> <email>susan.green@example.com</email> </customer> <customer> <customerid>4</customerid> <email>victory.alt@example.com</email> </customer> <customer> <customerid>5</customerid> <email>will.wippy@example.com</email> </customer> <customer> <customerid>6</customerid> <email>tim.raw@example.com</email> </customer> <customer> <customerid>7</customerid> <email>nick.fallow@example.com</email> </customer> <customer> <customerid>8</customerid> <email>ed.burton@example.com</email> </customer> <customer> <customerid>9</customerid> <email>jack.woo@example.com</email> </customer> <customer> <customerid>10</customerid> <email>maria.gonzales@example.com</email> </customer> </customers>
http://cvs.php.net/viewvc.cgi/pear/XML_Query2XML/tests/XML_Query2XML/ADOdbDefault/getXML/dynamicRowTag_callback.phpt?view=markup&rev=1.1 Index: pear/XML_Query2XML/tests/XML_Query2XML/ADOdbDefault/getXML/dynamicRowTag_callback.phpt +++ pear/XML_Query2XML/tests/XML_Query2XML/ADOdbDefault/getXML/dynamicRowTag_callback.phpt --TEST-- XML_Query2XML::getXML(): dynamicRowTag: callback function --SKIPIF-- <?php require_once dirname(dirname(__FILE__)) . '/skipif.php'; ?> --FILE-- <?php function getRowTagName($record) { return $record['last_name']; } require_once 'XML/Query2XML.php'; require_once dirname(dirname(__FILE__)) . '/db_init.php'; $query2xml = XML_Query2XML::factory($db); $dom = $query2xml->getXML( "SELECT * FROM customer", array( 'rootTag' => 'customers', 'idColumn' => 'customerid', 'rowTag' => 'customer', 'elements' => array( 'customerid', 'name_and_email' => array( 'dynamicRowTag' => '#getRowTagName', 'value' => 'email' ) ) ) ); header('Content-Type: application/xml'); $dom->formatOutput = true; print $dom->saveXML(); ?> --EXPECT-- <?xml version="1.0" encoding="UTF-8"?> <customers> <customer> <customerid>1</customerid> <Doe>jane.doe@example.com</Doe> </customer> <customer> <customerid>2</customerid> <Doe>john.doe@example.com</Doe> </customer> <customer> <customerid>3</customerid> <Green>susan.green@example.com</Green> </customer> <customer> <customerid>4</customerid> <Alt>victory.alt@example.com</Alt> </customer> <customer> <customerid>5</customerid> <Rippy>will.wippy@example.com</Rippy> </customer> <customer> <customerid>6</customerid> <Raw>tim.raw@example.com</Raw> </customer> <customer> <customerid>7</customerid> <Fallow>nick.fallow@example.com</Fallow> </customer> <customer> <customerid>8</customerid> <Burton>ed.burton@example.com</Burton> </customer> <customer> <customerid>9</customerid> <Woo>jack.woo@example.com</Woo> </customer> <customer> <customerid>10</customerid> <Gonzales>maria.gonzales@example.com</Gonzales> </customer> </customers> http://cvs.php.net/viewvc.cgi/pear/XML_Query2XML/tests/XML_Query2XML/ADOdbDefault/getXML/dynamicRowTag_columnName.phpt?view=markup&rev=1.1 Index: pear/XML_Query2XML/tests/XML_Query2XML/ADOdbDefault/getXML/dynamicRowTag_columnName.phpt +++ pear/XML_Query2XML/tests/XML_Query2XML/ADOdbDefault/getXML/dynamicRowTag_columnName.phpt --TEST-- XML_Query2XML::getXML(): dynamicRowTag: COLUMN NAME --SKIPIF-- <?php require_once dirname(dirname(__FILE__)) . '/skipif.php'; ?> --FILE-- <?php require_once 'XML/Query2XML.php'; require_once dirname(dirname(__FILE__)) . '/db_init.php'; $query2xml = XML_Query2XML::factory($db); $dom = $query2xml->getXML( "SELECT * FROM customer", array( 'rootTag' => 'customers', 'idColumn' => 'customerid', 'rowTag' => 'customer', 'elements' => array( 'customerid', 'name_and_email' => array( 'dynamicRowTag' => 'first_name', 'value' => 'email' ) ) ) ); header('Content-Type: application/xml'); $dom->formatOutput = true; print $dom->saveXML(); ?> --EXPECT-- <?xml version="1.0" encoding="UTF-8"?> <customers> <customer> <customerid>1</customerid> <Jane>jane.doe@example.com</Jane> </customer> <customer> <customerid>2</customerid> <John>john.doe@example.com</John> </customer> <customer> <customerid>3</customerid> <Susan>susan.green@example.com</Susan> </customer> <customer> <customerid>4</customerid> <Victoria>victory.alt@example.com</Victoria> </customer> <customer> <customerid>5</customerid> <Will>will.wippy@example.com</Will> </customer> <customer> <customerid>6</customerid> <Tim>tim.raw@example.com</Tim> </customer> <customer> <customerid>7</customerid> <Nick>nick.fallow@example.com</Nick> </customer> <customer> <customerid>8</customerid> <Ed>ed.burton@example.com</Ed> </customer> <customer> <customerid>9</customerid> <Jack>jack.woo@example.com</Jack> </customer> <customer> <customerid>10</customerid> <Maria>maria.gonzales@example.com</Maria> </customer> </customers> http://cvs.php.net/viewvc.cgi/pear/XML_Query2XML/tests/XML_Query2XML/ADOdbDefault/getXML/dynamicRowTag_columnName_ignoreRowTag.phpt?view=markup&rev=1.1 Index: pear/XML_Query2XML/tests/XML_Query2XML/ADOdbDefault/getXML/dynamicRowTag_columnName_ignoreRowTag.phpt +++ pear/XML_Query2XML/tests/XML_Query2XML/ADOdbDefault/getXML/dynamicRowTag_columnName_ignoreRowTag.phpt --TEST-- XML_Query2XML::getXML(): dynamicRowTag: ignoring $options['rowTag'] --SKIPIF-- <?php require_once dirname(dirname(__FILE__)) . '/skipif.php'; ?> --FILE-- <?php require_once 'XML/Query2XML.php'; require_once dirname(dirname(__FILE__)) . '/db_init.php'; $query2xml = XML_Query2XML::factory($db); $dom = $query2xml->getXML( "SELECT * FROM customer", array( 'rootTag' => 'customers', 'idColumn' => 'customerid', 'rowTag' => 'customer', 'elements' => array( 'customerid', 'name_and_email' => array( 'rowTag' => 'ignore_me', 'dynamicRowTag' => 'first_name', 'value' => 'email' ) ) ) ); header('Content-Type: application/xml'); $dom->formatOutput = true; print $dom->saveXML(); ?> --EXPECT-- <?xml version="1.0" encoding="UTF-8"?> <customers> <customer> <customerid>1</customerid> <Jane>jane.doe@example.com</Jane> </customer> <customer> <customerid>2</customerid> <John>john.doe@example.com</John> </customer> <customer> <customerid>3</customerid> <Susan>susan.green@example.com</Susan> </customer> <customer> <customerid>4</customerid> <Victoria>victory.alt@example.com</Victoria> </customer> <customer> <customerid>5</customerid> <Will>will.wippy@example.com</Will> </customer> <customer> <customerid>6</customerid> <Tim>tim.raw@example.com</Tim> </customer> <customer> <customerid>7</customerid> <Nick>nick.fallow@example.com</Nick> </customer> <customer> <customerid>8</customerid> <Ed>ed.burton@example.com</Ed> </customer> <customer> <customerid>9</customerid> <Jack>jack.woo@example.com</Jack> </customer> <customer> <customerid>10</customerid> <Maria>maria.gonzales@example.com</Maria> </customer> </customers> http://cvs.php.net/viewvc.cgi/pear/XML_Query2XML/tests/XML_Query2XML/ADOdbDefault/getXML/dynamicRowTag_columnName_onRootLevel.phpt?view=markup&rev=1.1 Index: pear/XML_Query2XML/tests/XML_Query2XML/ADOdbDefault/getXML/dynamicRowTag_columnName_onRootLevel.phpt +++ pear/XML_Query2XML/tests/XML_Query2XML/ADOdbDefault/getXML/dynamicRowTag_columnName_onRootLevel.phpt --TEST-- XML_Query2XML::getXML(): dynamicRowTag: COLUMN NAME on root level --SKIPIF-- <?php require_once dirname(dirname(__FILE__)) . '/skipif.php'; ?> --FILE-- <?php require_once 'XML/Query2XML.php'; require_once dirname(dirname(__FILE__)) . '/db_init.php'; $query2xml = XML_Query2XML::factory($db); $dom = $query2xml->getXML( "SELECT * FROM customer", array( 'rootTag' => 'customers', 'idColumn' => 'customerid', 'dynamicRowTag' => 'first_name', 'value' => 'email' ) ); header('Content-Type: application/xml'); $dom->formatOutput = true; print $dom->saveXML(); ?> --EXPECT-- <?xml version="1.0" encoding="UTF-8"?> <customers> <Jane>jane.doe@example.com</Jane> <John>john.doe@example.com</John> <Susan>susan.green@example.com</Susan> <Victoria>victory.alt@example.com</Victoria> <Will>will.wippy@example.com</Will> <Tim>tim.raw@example.com</Tim> <Nick>nick.fallow@example.com</Nick> <Ed>ed.burton@example.com</Ed> <Jack>jack.woo@example.com</Jack> <Maria>maria.gonzales@example.com</Maria> </customers> http://cvs.php.net/viewvc.cgi/pear/XML_Query2XML/tests/XML_Query2XML/ADOdbDefault/getXML/dynamicRowTag_commandObject.phpt?view=markup&rev=1.1 Index: pear/XML_Query2XML/tests/XML_Query2XML/ADOdbDefault/getXML/dynamicRowTag_commandObject.phpt +++ pear/XML_Query2XML/tests/XML_Query2XML/ADOdbDefault/getXML/dynamicRowTag_commandObject.phpt --TEST-- XML_Query2XML::getXML(): dynamicRowTag: COMMAND OBJECT --SKIPIF-- <?php require_once dirname(dirname(__FILE__)) . '/skipif.php'; ?> --FILE-- <?php require_once 'XML/Query2XML.php'; require_once 'XML/Query2XML/Callback.php'; require_once dirname(dirname(__FILE__)) . '/db_init.php'; class RowTagGenerator implements XML_Query2XML_Callback { public function execute(array $record) { return $record['last_name']; } } $query2xml = XML_Query2XML::factory($db); $dom = $query2xml->getXML( "SELECT * FROM customer", array( 'rootTag' => 'customers', 'idColumn' => 'customerid', 'rowTag' => 'customer', 'elements' => array( 'customerid', 'name_and_email' => array( 'dynamicRowTag' => new RowTagGenerator(), 'value' => 'email' ) ) ) ); header('Content-Type: application/xml'); $dom->formatOutput = true; print $dom->saveXML(); ?> --EXPECT-- <?xml version="1.0" encoding="UTF-8"?> <customers> <customer> <customerid>1</customerid> <Doe>jane.doe@example.com</Doe> </customer> <customer> <customerid>2</customerid> <Doe>john.doe@example.com</Doe> </customer> <customer> <customerid>3</customerid> <Green>susan.green@example.com</Green> </customer> <customer> <customerid>4</customerid> <Alt>victory.alt@example.com</Alt> </customer> <customer> <customerid>5</customerid> <Rippy>will.wippy@example.com</Rippy> </customer> <customer> <customerid>6</customerid> <Raw>tim.raw@example.com</Raw> </customer> <customer> <customerid>7</customerid> <Fallow>nick.fallow@example.com</Fallow> </customer> <customer> <customerid>8</customerid> <Burton>ed.burton@example.com</Burton> </customer> <customer> <customerid>9</customerid> <Woo>jack.woo@example.com</Woo> </customer> <customer> <customerid>10</customerid> <Gonzales>maria.gonzales@example.com</Gonzales> </customer> </customers> http://cvs.php.net/viewvc.cgi/pear/XML_Query2XML/tests/XML_Query2XML/ADOdbDefault/getXML/dynamicRowTag_staticString.phpt?view=markup&rev=1.1 Index: pear/XML_Query2XML/tests/XML_Query2XML/ADOdbDefault/getXML/dynamicRowTag_staticString.phpt +++ pear/XML_Query2XML/tests/XML_Query2XML/ADOdbDefault/getXML/dynamicRowTag_staticString.phpt --TEST-- XML_Query2XML::getXML(): dynamicRowTag: static string --SKIPIF-- <?php require_once dirname(dirname(__FILE__)) . '/skipif.php'; ?> --FILE-- <?php require_once 'XML/Query2XML.php'; require_once dirname(dirname(__FILE__)) . '/db_init.php'; $query2xml = XML_Query2XML::factory($db); $dom = $query2xml->getXML( "SELECT * FROM customer", array( 'rootTag' => 'customers', 'idColumn' => 'customerid', 'rowTag' => 'customer', 'elements' => array( 'customerid', 'name_and_email' => array( 'dynamicRowTag' => ':email', 'value' => 'email' ) ) ) ); header('Content-Type: application/xml'); $dom->formatOutput = true; print $dom->saveXML(); ?> --EXPECT-- <?xml version="1.0" encoding="UTF-8"?> <customers> <customer> <customerid>1</customerid> <email>jane.doe@example.com</email> </customer> <customer> <customerid>2</customerid> <email>john.doe@example.com</email> </customer> <customer> <customerid>3</customerid> <email>susan.green@example.com</email> </customer> <customer> <customerid>4</customerid> <email>victory.alt@example.com</email> </customer> <customer> <customerid>5</customerid> <email>will.wippy@example.com</email> </customer> <customer> <customerid>6</customerid> <email>tim.raw@example.com</email> </customer> <customer> <customerid>7</customerid> <email>nick.fallow@example.com</email> </customer> <customer> <customerid>8</customerid> <email>ed.burton@example.com</email> </customer> <customer> <customerid>9</customerid> <email>jack.woo@example.com</email> </customer> <customer> <customerid>10</customerid> <email>maria.gonzales@example.com</email> </customer> </customers> http://cvs.php.net/viewvc.cgi/pear/XML_Query2XML/tests/XML_Query2XML/ADOdbException/getXML/dynamicRowTag_callback.phpt?view=markup&rev=1.1 Index: pear/XML_Query2XML/tests/XML_Query2XML/ADOdbException/getXML/dynamicRowTag_callback.phpt +++ pear/XML_Query2XML/tests/XML_Query2XML/ADOdbException/getXML/dynamicRowTag_callback.phpt --TEST-- XML_Query2XML::getXML(): dynamicRowTag: callback function --SKIPIF-- <?php require_once dirname(dirname(__FILE__)) . '/skipif.php'; ?> --FILE-- <?php function getRowTagName($record) { return $record['last_name']; } require_once 'XML/Query2XML.php'; require_once dirname(dirname(__FILE__)) . '/db_init.php'; $query2xml = XML_Query2XML::factory($db); $dom = $query2xml->getXML( "SELECT * FROM customer", array( 'rootTag' => 'customers', 'idColumn' => 'customerid', 'rowTag' => 'customer', 'elements' => array( 'customerid', 'name_and_email' => array( 'dynamicRowTag' => '#getRowTagName', 'value' => 'email' ) ) ) ); header('Content-Type: application/xml'); $dom->formatOutput = true; print $dom->saveXML(); ?> --EXPECT-- <?xml version="1.0" encoding="UTF-8"?> <customers> <customer> <customerid>1</customerid> <Doe>jane.doe@example.com</Doe> </customer> <customer> <customerid>2</customerid> <Doe>john.doe@example.com</Doe> </customer> <customer> <customerid>3</customerid> <Green>susan.green@example.com</Green> </customer> <customer> <customerid>4</customerid> <Alt>victory.alt@example.com</Alt> </customer> <customer> <customerid>5</customerid> <Rippy>will.wippy@example.com</Rippy> </customer> <customer> <customerid>6</customerid> <Raw>tim.raw@example.com</Raw> </customer> <customer> <customerid>7</customerid> <Fallow>nick.fallow@example.com</Fallow> </customer> <customer> <customerid>8</customerid> <Burton>ed.burton@example.com</Burton> </customer> <customer> <customerid>9</customerid> <Woo>jack.woo@example.com</Woo> </customer> <customer> <customerid>10</customerid> <Gonzales>maria.gonzales@example.com</Gonzales> </customer> </customers> http://cvs.php.net/viewvc.cgi/pear/XML_Query2XML/tests/XML_Query2XML/ADOdbException/getXML/dynamicRowTag_columnName.phpt?view=markup&rev=1.1 Index: pear/XML_Query2XML/tests/XML_Query2XML/ADOdbException/getXML/dynamicRowTag_columnName.phpt +++ pear/XML_Query2XML/tests/XML_Query2XML/ADOdbException/getXML/dynamicRowTag_columnName.phpt --TEST-- XML_Query2XML::getXML(): dynamicRowTag: COLUMN NAME --SKIPIF-- <?php require_once dirname(dirname(__FILE__)) . '/skipif.php'; ?> --FILE-- <?php require_once 'XML/Query2XML.php'; require_once dirname(dirname(__FILE__)) . '/db_init.php'; $query2xml = XML_Query2XML::factory($db); $dom = $query2xml->getXML( "SELECT * FROM customer", array( 'rootTag' => 'customers', 'idColumn' => 'customerid', 'rowTag' => 'customer', 'elements' => array( 'customerid', 'name_and_email' => array( 'dynamicRowTag' => 'first_name', 'value' => 'email' ) ) ) ); header('Content-Type: application/xml'); $dom->formatOutput = true; print $dom->saveXML(); ?> --EXPECT-- <?xml version="1.0" encoding="UTF-8"?> <customers> <customer> <customerid>1</customerid> <Jane>jane.doe@example.com</Jane> </customer> <customer> <customerid>2</customerid> <John>john.doe@example.com</John> </customer> <customer> <customerid>3</customerid> <Susan>susan.green@example.com</Susan> </customer> <customer> <customerid>4</customerid> <Victoria>victory.alt@example.com</Victoria> </customer> <customer> <customerid>5</customerid> <Will>will.wippy@example.com</Will> </customer> <customer> <customerid>6</customerid> <Tim>tim.raw@example.com</Tim> </customer> <customer> <customerid>7</customerid> <Nick>nick.fallow@example.com</Nick> </customer> <customer> <customerid>8</customerid> <Ed>ed.burton@example.com</Ed> </customer> <customer> <customerid>9</customerid> <Jack>jack.woo@example.com</Jack> </customer> <customer> <customerid>10</customerid> <Maria>maria.gonzales@example.com</Maria> </customer> </customers> http://cvs.php.net/viewvc.cgi/pear/XML_Query2XML/tests/XML_Query2XML/ADOdbException/getXML/dynamicRowTag_columnName_ignoreRowTag.phpt?view=markup&rev=1.1 Index: pear/XML_Query2XML/tests/XML_Query2XML/ADOdbException/getXML/dynamicRowTag_columnName_ignoreRowTag.phpt +++ pear/XML_Query2XML/tests/XML_Query2XML/ADOdbException/getXML/dynamicRowTag_columnName_ignoreRowTag.phpt --TEST-- XML_Query2XML::getXML(): dynamicRowTag: ignoring $options['rowTag'] --SKIPIF-- <?php require_once dirname(dirname(__FILE__)) . '/skipif.php'; ?> --FILE-- <?php require_once 'XML/Query2XML.php'; require_once dirname(dirname(__FILE__)) . '/db_init.php'; $query2xml = XML_Query2XML::factory($db); $dom = $query2xml->getXML( "SELECT * FROM customer", array( 'rootTag' => 'customers', 'idColumn' => 'customerid', 'rowTag' => 'customer', 'elements' => array( 'customerid', 'name_and_email' => array( 'rowTag' => 'ignore_me', 'dynamicRowTag' => 'first_name', 'value' => 'email' ) ) ) ); header('Content-Type: application/xml'); $dom->formatOutput = true; print $dom->saveXML(); ?> --EXPECT-- <?xml version="1.0" encoding="UTF-8"?> <customers> <customer> <customerid>1</customerid> <Jane>jane.doe@example.com</Jane> </customer> <customer> <customerid>2</customerid> <John>john.doe@example.com</John> </customer> <customer> <customerid>3</customerid> <Susan>susan.green@example.com</Susan> </customer> <customer> <customerid>4</customerid> <Victoria>victory.alt@example.com</Victoria> </customer> <customer> <customerid>5</customerid> <Will>will.wippy@example.com</Will> </customer> <customer> <customerid>6</customerid> <Tim>tim.raw@example.com</Tim> </customer> <customer> <customerid>7</customerid> <Nick>nick.fallow@example.com</Nick> </customer> <customer> <customerid>8</customerid> <Ed>ed.burton@example.com</Ed> </customer> <customer> <customerid>9</customerid> <Jack>jack.woo@example.com</Jack> </customer> <customer> <customerid>10</customerid> <Maria>maria.gonzales@example.com</Maria> </customer> </customers> http://cvs.php.net/viewvc.cgi/pear/XML_Query2XML/tests/XML_Query2XML/ADOdbException/getXML/dynamicRowTag_columnName_onRootLevel.phpt?view=markup&rev=1.1 Index: pear/XML_Query2XML/tests/XML_Query2XML/ADOdbException/getXML/dynamicRowTag_columnName_onRootLevel.phpt +++ pear/XML_Query2XML/tests/XML_Query2XML/ADOdbException/getXML/dynamicRowTag_columnName_onRootLevel.phpt --TEST-- XML_Query2XML::getXML(): dynamicRowTag: COLUMN NAME on root level --SKIPIF-- <?php require_once dirname(dirname(__FILE__)) . '/skipif.php'; ?> --FILE-- <?php require_once 'XML/Query2XML.php'; require_once dirname(dirname(__FILE__)) . '/db_init.php'; $query2xml = XML_Query2XML::factory($db); $dom = $query2xml->getXML( "SELECT * FROM customer", array( 'rootTag' => 'customers', 'idColumn' => 'customerid', 'dynamicRowTag' => 'first_name', 'value' => 'email' ) ); header('Content-Type: application/xml'); $dom->formatOutput = true; print $dom->saveXML(); ?> --EXPECT-- <?xml version="1.0" encoding="UTF-8"?> <customers> <Jane>jane.doe@example.com</Jane> <John>john.doe@example.com</John> <Susan>susan.green@example.com</Susan> <Victoria>victory.alt@example.com</Victoria> <Will>will.wippy@example.com</Will> <Tim>tim.raw@example.com</Tim> <Nick>nick.fallow@example.com</Nick> <Ed>ed.burton@example.com</Ed> <Jack>jack.woo@example.com</Jack> <Maria>maria.gonzales@example.com</Maria> </customers> http://cvs.php.net/viewvc.cgi/pear/XML_Query2XML/tests/XML_Query2XML/ADOdbException/getXML/dynamicRowTag_commandObject.phpt?view=markup&rev=1.1 Index: pear/XML_Query2XML/tests/XML_Query2XML/ADOdbException/getXML/dynamicRowTag_commandObject.phpt +++ pear/XML_Query2XML/tests/XML_Query2XML/ADOdbException/getXML/dynamicRowTag_commandObject.phpt --TEST-- XML_Query2XML::getXML(): dynamicRowTag: COMMAND OBJECT --SKIPIF-- <?php require_once dirname(dirname(__FILE__)) . '/skipif.php'; ?> --FILE-- <?php require_once 'XML/Query2XML.php'; require_once 'XML/Query2XML/Callback.php'; require_once dirname(dirname(__FILE__)) . '/db_init.php'; class RowTagGenerator implements XML_Query2XML_Callback { public function execute(array $record) { return $record['last_name']; } } $query2xml = XML_Query2XML::factory($db); $dom = $query2xml->getXML( "SELECT * FROM customer", array( 'rootTag' => 'customers', 'idColumn' => 'customerid', 'rowTag' => 'customer', 'elements' => array( 'customerid', 'name_and_email' => array( 'dynamicRowTag' => new RowTagGenerator(), 'value' => 'email' ) ) ) ); header('Content-Type: application/xml'); $dom->formatOutput = true; print $dom->saveXML(); ?> --EXPECT-- <?xml version="1.0" encoding="UTF-8"?> <customers> <customer> <customerid>1</customerid> <Doe>jane.doe@example.com</Doe> </customer> <customer> <customerid>2</customerid> <Doe>john.doe@example.com</Doe> </customer> <customer> <customerid>3</customerid> <Green>susan.green@example.com</Green> </customer> <customer> <customerid>4</customerid> <Alt>victory.alt@example.com</Alt> </customer> <customer> <customerid>5</customerid> <Rippy>will.wippy@example.com</Rippy> </customer> <customer> <customerid>6</customerid> <Raw>tim.raw@example.com</Raw> </customer> <customer> <customerid>7</customerid> <Fallow>nick.fallow@example.com</Fallow> </customer> <customer> <customerid>8</customerid> <Burton>ed.burton@example.com</Burton> </customer> <customer> <customerid>9</customerid> <Woo>jack.woo@example.com</Woo> </customer> <customer> <customerid>10</customerid> <Gonzales>maria.gonzales@example.com</Gonzales> </customer> </customers> http://cvs.php.net/viewvc.cgi/pear/XML_Query2XML/tests/XML_Query2XML/ADOdbException/getXML/dynamicRowTag_staticString.phpt?view=markup&rev=1.1 Index: pear/XML_Query2XML/tests/XML_Query2XML/ADOdbException/getXML/dynamicRowTag_staticString.phpt +++ pear/XML_Query2XML/tests/XML_Query2XML/ADOdbException/getXML/dynamicRowTag_staticString.phpt --TEST-- XML_Query2XML::getXML(): dynamicRowTag: static string --SKIPIF-- <?php require_once dirname(dirname(__FILE__)) . '/skipif.php'; ?> --FILE-- <?php require_once 'XML/Query2XML.php'; require_once dirname(dirname(__FILE__)) . '/db_init.php'; $query2xml = XML_Query2XML::factory($db); $dom = $query2xml->getXML( "SELECT * FROM customer", array( 'rootTag' => 'customers', 'idColumn' => 'customerid', 'rowTag' => 'customer', 'elements' => array( 'customerid', 'name_and_email' => array( 'dynamicRowTag' => ':email', 'value' => 'email' ) ) ) ); header('Content-Type: application/xml'); $dom->formatOutput = true; print $dom->saveXML(); ?> --EXPECT-- <?xml version="1.0" encoding="UTF-8"?> <customers> <customer> <customerid>1</customerid> <email>jane.doe@example.com</email> </customer> <customer> <customerid>2</customerid> <email>john.doe@example.com</email> </customer> <customer> <customerid>3</customerid> <email>susan.green@example.com</email> </customer> <customer> <customerid>4</customerid> <email>victory.alt@example.com</email> </customer> <customer> <customerid>5</customerid> <email>will.wippy@example.com</email> </customer> <customer> <customerid>6</customerid> <email>tim.raw@example.com</email> </customer> <customer> <customerid>7</customerid> <email>nick.fallow@example.com</email> </customer> <customer> <customerid>8</customerid> <email>ed.burton@example.com</email> </customer> <customer> <customerid>9</customerid> <email>jack.woo@example.com</email> </customer> <customer> <customerid>10</customerid> <email>maria.gonzales@example.com</email> </customer> </customers> http://cvs.php.net/viewvc.cgi/pear/XML_Query2XML/tests/XML_Query2XML/ADOdbPEAR/getXML/dynamicRowTag_callback.phpt?view=markup&rev=1.1 Index: pear/XML_Query2XML/tests/XML_Query2XML/ADOdbPEAR/getXML/dynamicRowTag_callback.phpt +++ pear/XML_Query2XML/tests/XML_Query2XML/ADOdbPEAR/getXML/dynamicRowTag_callback.phpt --TEST-- XML_Query2XML::getXML(): dynamicRowTag: callback function --SKIPIF-- <?php require_once dirname(dirname(__FILE__)) . '/skipif.php'; ?> --FILE-- <?php function getRowTagName($record) { return $record['last_name']; } require_once 'XML/Query2XML.php'; require_once dirname(dirname(__FILE__)) . '/db_init.php'; $query2xml = XML_Query2XML::factory($db); $dom = $query2xml->getXML( "SELECT * FROM customer", array( 'rootTag' => 'customers', 'idColumn' => 'customerid', 'rowTag' => 'customer', 'elements' => array( 'customerid', 'name_and_email' => array( 'dynamicRowTag' => '#getRowTagName', 'value' => 'email' ) ) ) ); header('Content-Type: application/xml'); $dom->formatOutput = true; print $dom->saveXML(); ?> --EXPECT-- <?xml version="1.0" encoding="UTF-8"?> <customers> <customer> <customerid>1</customerid> <Doe>jane.doe@example.com</Doe> </customer> <customer> <customerid>2</customerid> <Doe>john.doe@example.com</Doe> </customer> <customer> <customerid>3</customerid> <Green>susan.green@example.com</Green> </customer> <customer> <customerid>4</customerid> <Alt>victory.alt@example.com</Alt> </customer> <customer> <customerid>5</customerid> <Rippy>will.wippy@example.com</Rippy> </customer> <customer> <customerid>6</customerid> <Raw>tim.raw@example.com</Raw> </customer> <customer> <customerid>7</customerid> <Fallow>nick.fallow@example.com</Fallow> </customer> <customer> <customerid>8</customerid> <Burton>ed.burton@example.com</Burton> </customer> <customer> <customerid>9</customerid> <Woo>jack.woo@example.com</Woo> </customer> <customer> <customerid>10</customerid> <Gonzales>maria.gonzales@example.com</Gonzales> </customer> </customers> http://cvs.php.net/viewvc.cgi/pear/XML_Query2XML/tests/XML_Query2XML/ADOdbPEAR/getXML/dynamicRowTag_columnName.phpt?view=markup&rev=1.1 Index: pear/XML_Query2XML/tests/XML_Query2XML/ADOdbPEAR/getXML/dynamicRowTag_columnName.phpt +++ pear/XML_Query2XML/tests/XML_Query2XML/ADOdbPEAR/getXML/dynamicRowTag_columnName.phpt --TEST-- XML_Query2XML::getXML(): dynamicRowTag: COLUMN NAME --SKIPIF-- <?php require_once dirname(dirname(__FILE__)) . '/skipif.php'; ?> --FILE-- <?php require_once 'XML/Query2XML.php'; require_once dirname(dirname(__FILE__)) . '/db_init.php'; $query2xml = XML_Query2XML::factory($db); $dom = $query2xml->getXML( "SELECT * FROM customer", array( 'rootTag' => 'customers', 'idColumn' => 'customerid', 'rowTag' => 'customer', 'elements' => array( 'customerid', 'name_and_email' => array( 'dynamicRowTag' => 'first_name', 'value' => 'email' ) ) ) ); header('Content-Type: application/xml'); $dom->formatOutput = true; print $dom->saveXML(); ?> --EXPECT-- <?xml version="1.0" encoding="UTF-8"?> <customers> <customer> <customerid>1</customerid> <Jane>jane.doe@example.com</Jane> </customer> <customer> <customerid>2</customerid> <John>john.doe@example.com</John> </customer> <customer> <customerid>3</customerid> <Susan>susan.green@example.com</Susan> </customer> <customer> <customerid>4</customerid> <Victoria>victory.alt@example.com</Victoria> </customer> <customer> <customerid>5</customerid> <Will>will.wippy@example.com</Will> </customer> <customer> <customerid>6</customerid> <Tim>tim.raw@example.com</Tim> </customer> <customer> <customerid>7</customerid> <Nick>nick.fallow@example.com</Nick> </customer> <customer> <customerid>8</customerid> <Ed>ed.burton@example.com</Ed> </customer> <customer> <customerid>9</customerid> <Jack>jack.woo@example.com</Jack> </customer> <customer> <customerid>10</customerid> <Maria>maria.gonzales@example.com</Maria> </customer> </customers> http://cvs.php.net/viewvc.cgi/pear/XML_Query2XML/tests/XML_Query2XML/ADOdbPEAR/getXML/dynamicRowTag_columnName_ignoreRowTag.phpt?view=markup&rev=1.1 Index: pear/XML_Query2XML/tests/XML_Query2XML/ADOdbPEAR/getXML/dynamicRowTag_columnName_ignoreRowTag.phpt +++ pear/XML_Query2XML/tests/XML_Query2XML/ADOdbPEAR/getXML/dynamicRowTag_columnName_ignoreRowTag.phpt --TEST-- XML_Query2XML::getXML(): dynamicRowTag: ignoring $options['rowTag'] --SKIPIF-- <?php require_once dirname(dirname(__FILE__)) . '/skipif.php'; ?> --FILE-- <?php require_once 'XML/Query2XML.php'; require_once dirname(dirname(__FILE__)) . '/db_init.php'; $query2xml = XML_Query2XML::factory($db); $dom = $query2xml->getXML( "SELECT * FROM customer", array( 'rootTag' => 'customers', 'idColumn' => 'customerid', 'rowTag' => 'customer', 'elements' => array( 'customerid', 'name_and_email' => array( 'rowTag' => 'ignore_me', 'dynamicRowTag' => 'first_name', 'value' => 'email' ) ) ) ); header('Content-Type: application/xml'); $dom->formatOutput = true; print $dom->saveXML(); ?> --EXPECT-- <?xml version="1.0" encoding="UTF-8"?> <customers> <customer> <customerid>1</customerid> <Jane>jane.doe@example.com</Jane> </customer> <customer> <customerid>2</customerid> <John>john.doe@example.com</John> </customer> <customer> <customerid>3</customerid> <Susan>susan.green@example.com</Susan> </customer> <customer> <customerid>4</customerid> <Victoria>victory.alt@example.com</Victoria> </customer> <customer> <customerid>5</customerid> <Will>will.wippy@example.com</Will> </customer> <customer> <customerid>6</customerid> <Tim>tim.raw@example.com</Tim> </customer> <customer> <customerid>7</customerid> <Nick>nick.fallow@example.com</Nick> </customer> <customer> <customerid>8</customerid> <Ed>ed.burton@example.com</Ed> </customer> <customer> <customerid>9</customerid> <Jack>jack.woo@example.com</Jack> </customer> <customer> <customerid>10</customerid> <Maria>maria.gonzales@example.com</Maria> </customer> </customers> http://cvs.php.net/viewvc.cgi/pear/XML_Query2XML/tests/XML_Query2XML/ADOdbPEAR/getXML/dynamicRowTag_columnName_onRootLevel.phpt?view=markup&rev=1.1 Index: pear/XML_Query2XML/tests/XML_Query2XML/ADOdbPEAR/getXML/dynamicRowTag_columnName_onRootLevel.phpt +++ pear/XML_Query2XML/tests/XML_Query2XML/ADOdbPEAR/getXML/dynamicRowTag_columnName_onRootLevel.phpt --TEST-- XML_Query2XML::getXML(): dynamicRowTag: COLUMN NAME on root level --SKIPIF-- <?php require_once dirname(dirname(__FILE__)) . '/skipif.php'; ?> --FILE-- <?php require_once 'XML/Query2XML.php'; require_once dirname(dirname(__FILE__)) . '/db_init.php'; $query2xml = XML_Query2XML::factory($db); $dom = $query2xml->getXML( "SELECT * FROM customer", array( 'rootTag' => 'customers', 'idColumn' => 'customerid', 'dynamicRowTag' => 'first_name', 'value' => 'email' ) ); header('Content-Type: application/xml'); $dom->formatOutput = true; print $dom->saveXML(); ?> --EXPECT-- <?xml version="1.0" encoding="UTF-8"?> <customers> <Jane>jane.doe@example.com</Jane> <John>john.doe@example.com</John> <Susan>susan.green@example.com</Susan> <Victoria>victory.alt@example.com</Victoria> <Will>will.wippy@example.com</Will> <Tim>tim.raw@example.com</Tim> <Nick>nick.fallow@example.com</Nick> <Ed>ed.burton@example.com</Ed> <Jack>jack.woo@example.com</Jack> <Maria>maria.gonzales@example.com</Maria> </customers> http://cvs.php.net/viewvc.cgi/pear/XML_Query2XML/tests/XML_Query2XML/ADOdbPEAR/getXML/dynamicRowTag_commandObject.phpt?view=markup&rev=1.1 Index: pear/XML_Query2XML/tests/XML_Query2XML/ADOdbPEAR/getXML/dynamicRowTag_commandObject.phpt +++ pear/XML_Query2XML/tests/XML_Query2XML/ADOdbPEAR/getXML/dynamicRowTag_commandObject.phpt --TEST-- XML_Query2XML::getXML(): dynamicRowTag: COMMAND OBJECT --SKIPIF-- <?php require_once dirname(dirname(__FILE__)) . '/skipif.php'; ?> --FILE-- <?php require_once 'XML/Query2XML.php'; require_once 'XML/Query2XML/Callback.php'; require_once dirname(dirname(__FILE__)) . '/db_init.php'; class RowTagGenerator implements XML_Query2XML_Callback { public function execute(array $record) { return $record['last_name']; } } $query2xml = XML_Query2XML::factory($db); $dom = $query2xml->getXML( "SELECT * FROM customer", array( 'rootTag' => 'customers', 'idColumn' => 'customerid', 'rowTag' => 'customer', 'elements' => array( 'customerid', 'name_and_email' => array( 'dynamicRowTag' => new RowTagGenerator(), 'value' => 'email' ) ) ) ); header('Content-Type: application/xml'); $dom->formatOutput = true; print $dom->saveXML(); ?> --EXPECT-- <?xml version="1.0" encoding="UTF-8"?> <customers> <customer> <customerid>1</customerid> <Doe>jane.doe@example.com</Doe> </customer> <customer> <customerid>2</customerid> <Doe>john.doe@example.com</Doe> </customer> <customer> <customerid>3</customerid> <Green>susan.green@example.com</Green> </customer> <customer> <customerid>4</customerid> <Alt>victory.alt@example.com</Alt> </customer> <customer> <customerid>5</customerid> <Rippy>will.wippy@example.com</Rippy> </customer> <customer> <customerid>6</customerid> <Raw>tim.raw@example.com</Raw> </customer> <customer> <customerid>7</customerid> <Fallow>nick.fallow@example.com</Fallow> </customer> <customer> <customerid>8</customerid> <Burton>ed.burton@example.com</Burton> </customer> <customer> <customerid>9</customerid> <Woo>jack.woo@example.com</Woo> </customer> <customer> <customerid>10</customerid> <Gonzales>maria.gonzales@example.com</Gonzales> </customer> </customers> http://cvs.php.net/viewvc.cgi/pear/XML_Query2XML/tests/XML_Query2XML/ADOdbPEAR/getXML/dynamicRowTag_staticString.phpt?view=markup&rev=1.1 Index: pear/XML_Query2XML/tests/XML_Query2XML/ADOdbPEAR/getXML/dynamicRowTag_staticString.phpt +++ pear/XML_Query2XML/tests/XML_Query2XML/ADOdbPEAR/getXML/dynamicRowTag_staticString.phpt --TEST-- XML_Query2XML::getXML(): dynamicRowTag: static string --SKIPIF-- <?php require_once dirname(dirname(__FILE__)) . '/skipif.php'; ?> --FILE-- <?php require_once 'XML/Query2XML.php'; require_once dirname(dirname(__FILE__)) . '/db_init.php'; $query2xml = XML_Query2XML::factory($db); $dom = $query2xml->getXML( "SELECT * FROM customer", array( 'rootTag' => 'customers', 'idColumn' => 'customerid', 'rowTag' => 'customer', 'elements' => array( 'customerid', 'name_and_email' => array( 'dynamicRowTag' => ':email', 'value' => 'email' ) ) ) ); header('Content-Type: application/xml'); $dom->formatOutput = true; print $dom->saveXML(); ?> --EXPECT-- <?xml version="1.0" encoding="UTF-8"?> <customers> <customer> <customerid>1</customerid> <email>jane.doe@example.com</email> </customer> <customer> <customerid>2</customerid> <email>john.doe@example.com</email> </customer> <customer> <customerid>3</customerid> <email>susan.green@example.com</email> </customer> <customer> <customerid>4</customerid> <email>victory.alt@example.com</email> </customer> <customer> <customerid>5</customerid> <email>will.wippy@example.com</email> </customer> <customer> <customerid>6</customerid> <email>tim.raw@example.com</email> </customer> <customer> <customerid>7</customerid> <email>nick.fallow@example.com</email> </customer> <customer> <customerid>8</customerid> <email>ed.burton@example.com</email> </customer> <customer> <customerid>9</customerid> <email>jack.woo@example.com</email> </customer> <customer> <customerid>10</customerid> <email>maria.gonzales@example.com</email> </customer> </customers> http://cvs.php.net/viewvc.cgi/pear/XML_Query2XML/tests/XML_Query2XML/DB/getXML/dynamicRowTag_callback.phpt?view=markup&rev=1.1 Index: pear/XML_Query2XML/tests/XML_Query2XML/DB/getXML/dynamicRowTag_callback.phpt +++ pear/XML_Query2XML/tests/XML_Query2XML/DB/getXML/dynamicRowTag_callback.phpt --TEST-- XML_Query2XML::getXML(): dynamicRowTag: callback function --SKIPIF-- <?php require_once dirname(dirname(__FILE__)) . '/skipif.php'; ?> --FILE-- <?php function getRowTagName($record) { return $record['last_name']; } require_once 'XML/Query2XML.php'; require_once dirname(dirname(__FILE__)) . '/db_init.php'; $query2xml = XML_Query2XML::factory($db); $dom = $query2xml->getXML( "SELECT * FROM customer", array( 'rootTag' => 'customers', 'idColumn' => 'customerid', 'rowTag' => 'customer', 'elements' => array( 'customerid', 'name_and_email' => array( 'dynamicRowTag' => '#getRowTagName', 'value' => 'email' ) ) ) ); header('Content-Type: application/xml'); $dom->formatOutput = true; print $dom->saveXML(); ?> --EXPECT-- <?xml version="1.0" encoding="UTF-8"?> <customers> <customer> <customerid>1</customerid> <Doe>jane.doe@example.com</Doe> </customer> <customer> <customerid>2</customerid> <Doe>john.doe@example.com</Doe> </customer> <customer> <customerid>3</customerid> <Green>susan.green@example.com</Green> </customer> <customer> <customerid>4</customerid> <Alt>victory.alt@example.com</Alt> </customer> <customer> <customerid>5</customerid> <Rippy>will.wippy@example.com</Rippy> </customer> <customer> <customerid>6</customerid> <Raw>tim.raw@example.com</Raw> </customer> <customer> <customerid>7</customerid> <Fallow>nick.fallow@example.com</Fallow> </customer> <customer> <customerid>8</customerid> <Burton>ed.burton@example.com</Burton> </customer> <customer> <customerid>9</customerid> <Woo>jack.woo@example.com</Woo> </customer> <customer> <customerid>10</customerid> <Gonzales>maria.gonzales@example.com</Gonzales> </customer> </customers> http://cvs.php.net/viewvc.cgi/pear/XML_Query2XML/tests/XML_Query2XML/DB/getXML/dynamicRowTag_columnName.phpt?view=markup&rev=1.1 Index: pear/XML_Query2XML/tests/XML_Query2XML/DB/getXML/dynamicRowTag_columnName.phpt +++ pear/XML_Query2XML/tests/XML_Query2XML/DB/getXML/dynamicRowTag_columnName.phpt --TEST-- XML_Query2XML::getXML(): dynamicRowTag: COLUMN NAME --SKIPIF-- <?php require_once dirname(dirname(__FILE__)) . '/skipif.php'; ?> --FILE-- <?php require_once 'XML/Query2XML.php'; require_once dirname(dirname(__FILE__)) . '/db_init.php'; $query2xml = XML_Query2XML::factory($db); $dom = $query2xml->getXML( "SELECT * FROM customer", array( 'rootTag' => 'customers', 'idColumn' => 'customerid', 'rowTag' => 'customer', 'elements' => array( 'customerid', 'name_and_email' => array( 'dynamicRowTag' => 'first_name', 'value' => 'email' ) ) ) ); header('Content-Type: application/xml'); $dom->formatOutput = true; print $dom->saveXML(); ?> --EXPECT-- <?xml version="1.0" encoding="UTF-8"?> <customers> <customer> <customerid>1</customerid> <Jane>jane.doe@example.com</Jane> </customer> <customer> <customerid>2</customerid> <John>john.doe@example.com</John> </customer> <customer> <customerid>3</customerid> <Susan>susan.green@example.com</Susan> </customer> <customer> <customerid>4</customerid> <Victoria>victory.alt@example.com</Victoria> </customer> <customer> <customerid>5</customerid> <Will>will.wippy@example.com</Will> </customer> <customer> <customerid>6</customerid> <Tim>tim.raw@example.com</Tim> </customer> <customer> <customerid>7</customerid> <Nick>nick.fallow@example.com</Nick> </customer> <customer> <customerid>8</customerid> <Ed>ed.burton@example.com</Ed> </customer> <customer> <customerid>9</customerid> <Jack>jack.woo@example.com</Jack> </customer> <customer> <customerid>10</customerid> <Maria>maria.gonzales@example.com</Maria> </customer> </customers> http://cvs.php.net/viewvc.cgi/pear/XML_Query2XML/tests/XML_Query2XML/DB/getXML/dynamicRowTag_columnName_ignoreRowTag.phpt?view=markup&rev=1.1 Index: pear/XML_Query2XML/tests/XML_Query2XML/DB/getXML/dynamicRowTag_columnName_ignoreRowTag.phpt +++ pear/XML_Query2XML/tests/XML_Query2XML/DB/getXML/dynamicRowTag_columnName_ignoreRowTag.phpt --TEST-- XML_Query2XML::getXML(): dynamicRowTag: ignoring $options['rowTag'] --SKIPIF-- <?php require_once dirname(dirname(__FILE__)) . '/skipif.php'; ?> --FILE-- <?php require_once 'XML/Query2XML.php'; require_once dirname(dirname(__FILE__)) . '/db_init.php'; $query2xml = XML_Query2XML::factory($db); $dom = $query2xml->getXML( "SELECT * FROM customer", array( 'rootTag' => 'customers', 'idColumn' => 'customerid', 'rowTag' => 'customer', 'elements' => array( 'customerid', 'name_and_email' => array( 'rowTag' => 'ignore_me', 'dynamicRowTag' => 'first_name', 'value' => 'email' ) ) ) ); header('Content-Type: application/xml'); $dom->formatOutput = true; print $dom->saveXML(); ?> --EXPECT-- <?xml version="1.0" encoding="UTF-8"?> <customers> <customer> <customerid>1</customerid> <Jane>jane.doe@example.com</Jane> </customer> <customer> <customerid>2</customerid> <John>john.doe@example.com</John> </customer> <customer> <customerid>3</customerid> <Susan>susan.green@example.com</Susan> </customer> <customer> <customerid>4</customerid> <Victoria>victory.alt@example.com</Victoria> </customer> <customer> <customerid>5</customerid> <Will>will.wippy@example.com</Will> </customer> <customer> <customerid>6</customerid> <Tim>tim.raw@example.com</Tim> </customer> <customer> <customerid>7</customerid> <Nick>nick.fallow@example.com</Nick> </customer> <customer> <customerid>8</customerid> <Ed>ed.burton@example.com</Ed> </customer> <customer> <customerid>9</customerid> <Jack>jack.woo@example.com</Jack> </customer> <customer> <customerid>10</customerid> <Maria>maria.gonzales@example.com</Maria> </customer> </customers> http://cvs.php.net/viewvc.cgi/pear/XML_Query2XML/tests/XML_Query2XML/DB/getXML/dynamicRowTag_columnName_onRootLevel.phpt?view=markup&rev=1.1 Index: pear/XML_Query2XML/tests/XML_Query2XML/DB/getXML/dynamicRowTag_columnName_onRootLevel.phpt +++ pear/XML_Query2XML/tests/XML_Query2XML/DB/getXML/dynamicRowTag_columnName_onRootLevel.phpt --TEST-- XML_Query2XML::getXML(): dynamicRowTag: COLUMN NAME on root level --SKIPIF-- <?php require_once dirname(dirname(__FILE__)) . '/skipif.php'; ?> --FILE-- <?php require_once 'XML/Query2XML.php'; require_once dirname(dirname(__FILE__)) . '/db_init.php'; $query2xml = XML_Query2XML::factory($db); $dom = $query2xml->getXML( "SELECT * FROM customer", array( 'rootTag' => 'customers', 'idColumn' => 'customerid', 'dynamicRowTag' => 'first_name', 'value' => 'email' ) ); header('Content-Type: application/xml'); $dom->formatOutput = true; print $dom->saveXML(); ?> --EXPECT-- <?xml version="1.0" encoding="UTF-8"?> <customers> <Jane>jane.doe@example.com</Jane> <John>john.doe@example.com</John> <Susan>susan.green@example.com</Susan> <Victoria>victory.alt@example.com</Victoria> <Will>will.wippy@example.com</Will> <Tim>tim.raw@example.com</Tim> <Nick>nick.fallow@example.com</Nick> <Ed>ed.burton@example.com</Ed> <Jack>jack.woo@example.com</Jack> <Maria>maria.gonzales@example.com</Maria> </customers> http://cvs.php.net/viewvc.cgi/pear/XML_Query2XML/tests/XML_Query2XML/DB/getXML/dynamicRowTag_commandObject.phpt?view=markup&rev=1.1 Index: pear/XML_Query2XML/tests/XML_Query2XML/DB/getXML/dynamicRowTag_commandObject.phpt +++ pear/XML_Query2XML/tests/XML_Query2XML/DB/getXML/dynamicRowTag_commandObject.phpt --TEST-- XML_Query2XML::getXML(): dynamicRowTag: COMMAND OBJECT --SKIPIF-- <?php require_once dirname(dirname(__FILE__)) . '/skipif.php'; ?> --FILE-- <?php require_once 'XML/Query2XML.php'; require_once 'XML/Query2XML/Callback.php'; require_once dirname(dirname(__FILE__)) . '/db_init.php'; class RowTagGenerator implements XML_Query2XML_Callback { public function execute(array $record) { return $record['last_name']; } } $query2xml = XML_Query2XML::factory($db); $dom = $query2xml->getXML( "SELECT * FROM customer", array( 'rootTag' => 'customers', 'idColumn' => 'customerid', 'rowTag' => 'customer', 'elements' => array( 'customerid', 'name_and_email' => array( 'dynamicRowTag' => new RowTagGenerator(), 'value' => 'email' ) ) ) ); header('Content-Type: application/xml'); $dom->formatOutput = true; print $dom->saveXML(); ?> --EXPECT-- <?xml version="1.0" encoding="UTF-8"?> <customers> <customer> <customerid>1</customerid> <Doe>jane.doe@example.com</Doe> </customer> <customer> <customerid>2</customerid> <Doe>john.doe@example.com</Doe> </customer> <customer> <customerid>3</customerid> <Green>susan.green@example.com</Green> </customer> <customer> <customerid>4</customerid> <Alt>victory.alt@example.com</Alt> </customer> <customer> <customerid>5</customerid> <Rippy>will.wippy@example.com</Rippy> </customer> <customer> <customerid>6</customerid> <Raw>tim.raw@example.com</Raw> </customer> <customer> <customerid>7</customerid> <Fallow>nick.fallow@example.com</Fallow> </customer> <customer> <customerid>8</customerid> <Burton>ed.burton@example.com</Burton> </customer> <customer> <customerid>9</customerid> <Woo>jack.woo@example.com</Woo> </customer> <customer> <customerid>10</customerid> <Gonzales>maria.gonzales@example.com</Gonzales> </customer> </customers> http://cvs.php.net/viewvc.cgi/pear/XML_Query2XML/tests/XML_Query2XML/DB/getXML/dynamicRowTag_staticString.phpt?view=markup&rev=1.1 Index: pear/XML_Query2XML/tests/XML_Query2XML/DB/getXML/dynamicRowTag_staticString.phpt +++ pear/XML_Query2XML/tests/XML_Query2XML/DB/getXML/dynamicRowTag_staticString.phpt --TEST-- XML_Query2XML::getXML(): dynamicRowTag: static string --SKIPIF-- <?php require_once dirname(dirname(__FILE__)) . '/skipif.php'; ?> --FILE-- <?php require_once 'XML/Query2XML.php'; require_once dirname(dirname(__FILE__)) . '/db_init.php'; $query2xml = XML_Query2XML::factory($db); $dom = $query2xml->getXML( "SELECT * FROM customer", array( 'rootTag' => 'customers', 'idColumn' => 'customerid', 'rowTag' => 'customer', 'elements' => array( 'customerid', 'name_and_email' => array( 'dynamicRowTag' => ':email', 'value' => 'email' ) ) ) ); header('Content-Type: application/xml'); $dom->formatOutput = true; print $dom->saveXML(); ?> --EXPECT-- <?xml version="1.0" encoding="UTF-8"?> <customers> <customer> <customerid>1</customerid> <email>jane.doe@example.com</email> </customer> <customer> <customerid>2</customerid> <email>john.doe@example.com</email> </customer> <customer> <customerid>3</customerid> <email>susan.green@example.com</email> </customer> <customer> <customerid>4</customerid> <email>victory.alt@example.com</email> </customer> <customer> <customerid>5</customerid> <email>will.wippy@example.com</email> </customer> <customer> <customerid>6</customerid> <email>tim.raw@example.com</email> </customer> <customer> <customerid>7</customerid> <email>nick.fallow@example.com</email> </customer> <customer> <customerid>8</customerid> <email>ed.burton@example.com</email> </customer> <customer> <customerid>9</customerid> <email>jack.woo@example.com</email> </customer> <customer> <customerid>10</customerid> <email>maria.gonzales@example.com</email> </customer> </customers> http://cvs.php.net/viewvc.cgi/pear/XML_Query2XML/tests/XML_Query2XML/MDB2/getXML/dynamicRowTag_callback.phpt?view=markup&rev=1.1 Index: pear/XML_Query2XML/tests/XML_Query2XML/MDB2/getXML/dynamicRowTag_callback.phpt +++ pear/XML_Query2XML/tests/XML_Query2XML/MDB2/getXML/dynamicRowTag_callback.phpt --TEST-- XML_Query2XML::getXML(): dynamicRowTag: callback function --SKIPIF-- <?php require_once dirname(dirname(__FILE__)) . '/skipif.php'; ?> --FILE-- <?php function getRowTagName($record) { return $record['last_name']; } require_once 'XML/Query2XML.php'; require_once dirname(dirname(__FILE__)) . '/db_init.php'; $query2xml = XML_Query2XML::factory($db); $dom = $query2xml->getXML( "SELECT * FROM customer", array( 'rootTag' => 'customers', 'idColumn' => 'customerid', 'rowTag' => 'customer', 'elements' => array( 'customerid', 'name_and_email' => array( 'dynamicRowTag' => '#getRowTagName', 'value' => 'email' ) ) ) ); header('Content-Type: application/xml'); $dom->formatOutput = true; print $dom->saveXML(); ?> --EXPECT-- <?xml version="1.0" encoding="UTF-8"?> <customers> <customer> <customerid>1</customerid> <Doe>jane.doe@example.com</Doe> </customer> <customer> <customerid>2</customerid> <Doe>john.doe@example.com</Doe> </customer> <customer> <customerid>3</customerid> <Green>susan.green@example.com</Green> </customer> <customer> <customerid>4</customerid> <Alt>victory.alt@example.com</Alt> </customer> <customer> <customerid>5</customerid> <Rippy>will.wippy@example.com</Rippy> </customer> <customer> <customerid>6</customerid> <Raw>tim.raw@example.com</Raw> </customer> <customer> <customerid>7</customerid> <Fallow>nick.fallow@example.com</Fallow> </customer> <customer> <customerid>8</customerid> <Burton>ed.burton@example.com</Burton> </customer> <customer> <customerid>9</customerid> <Woo>jack.woo@example.com</Woo> </customer> <customer> <customerid>10</customerid> <Gonzales>maria.gonzales@example.com</Gonzales> </customer> </customers> http://cvs.php.net/viewvc.cgi/pear/XML_Query2XML/tests/XML_Query2XML/MDB2/getXML/dynamicRowTag_columnName.phpt?view=markup&rev=1.1 Index: pear/XML_Query2XML/tests/XML_Query2XML/MDB2/getXML/dynamicRowTag_columnName.phpt +++ pear/XML_Query2XML/tests/XML_Query2XML/MDB2/getXML/dynamicRowTag_columnName.phpt --TEST-- XML_Query2XML::getXML(): dynamicRowTag: COLUMN NAME --SKIPIF-- <?php require_once dirname(dirname(__FILE__)) . '/skipif.php'; ?> --FILE-- <?php require_once 'XML/Query2XML.php'; require_once dirname(dirname(__FILE__)) . '/db_init.php'; $query2xml = XML_Query2XML::factory($db); $dom = $query2xml->getXML( "SELECT * FROM customer", array( 'rootTag' => 'customers', 'idColumn' => 'customerid', 'rowTag' => 'customer', 'elements' => array( 'customerid', 'name_and_email' => array( 'dynamicRowTag' => 'first_name', 'value' => 'email' ) ) ) ); header('Content-Type: application/xml'); $dom->formatOutput = true; print $dom->saveXML(); ?> --EXPECT-- <?xml version="1.0" encoding="UTF-8"?> <customers> <customer> <customerid>1</customerid> <Jane>jane.doe@example.com</Jane> </customer> <customer> <customerid>2</customerid> <John>john.doe@example.com</John> </customer> <customer> <customerid>3</customerid> <Susan>susan.green@example.com</Susan> </customer> <customer> <customerid>4</customerid> <Victoria>victory.alt@example.com</Victoria> </customer> <customer> <customerid>5</customerid> <Will>will.wippy@example.com</Will> </customer> <customer> <customerid>6</customerid> <Tim>tim.raw@example.com</Tim> </customer> <customer> <customerid>7</customerid> <Nick>nick.fallow@example.com</Nick> </customer> <customer> <customerid>8</customerid> <Ed>ed.burton@example.com</Ed> </customer> <customer> <customerid>9</customerid> <Jack>jack.woo@example.com</Jack> </customer> <customer> <customerid>10</customerid> <Maria>maria.gonzales@example.com</Maria> </customer> </customers> http://cvs.php.net/viewvc.cgi/pear/XML_Query2XML/tests/XML_Query2XML/MDB2/getXML/dynamicRowTag_columnName_ignoreRowTag.phpt?view=markup&rev=1.1 Index: pear/XML_Query2XML/tests/XML_Query2XML/MDB2/getXML/dynamicRowTag_columnName_ignoreRowTag.phpt +++ pear/XML_Query2XML/tests/XML_Query2XML/MDB2/getXML/dynamicRowTag_columnName_ignoreRowTag.phpt --TEST-- XML_Query2XML::getXML(): dynamicRowTag: ignoring $options['rowTag'] --SKIPIF-- <?php require_once dirname(dirname(__FILE__)) . '/skipif.php'; ?> --FILE-- <?php require_once 'XML/Query2XML.php'; require_once dirname(dirname(__FILE__)) . '/db_init.php'; $query2xml = XML_Query2XML::factory($db); $dom = $query2xml->getXML( "SELECT * FROM customer", array( 'rootTag' => 'customers', 'idColumn' => 'customerid', 'rowTag' => 'customer', 'elements' => array( 'customerid', 'name_and_email' => array( 'rowTag' => 'ignore_me', 'dynamicRowTag' => 'first_name', 'value' => 'email' ) ) ) ); header('Content-Type: application/xml'); $dom->formatOutput = true; print $dom->saveXML(); ?> --EXPECT-- <?xml version="1.0" encoding="UTF-8"?> <customers> <customer> <customerid>1</customerid> <Jane>jane.doe@example.com</Jane> </customer> <customer> <customerid>2</customerid> <John>john.doe@example.com</John> </customer> <customer> <customerid>3</customerid> <Susan>susan.green@example.com</Susan> </customer> <customer> <customerid>4</customerid> <Victoria>victory.alt@example.com</Victoria> </customer> <customer> <customerid>5</customerid> <Will>will.wippy@example.com</Will> </customer> <customer> <customerid>6</customerid> <Tim>tim.raw@example.com</Tim> </customer> <customer> <customerid>7</customerid> <Nick>nick.fallow@example.com</Nick> </customer> <customer> <customerid>8</customerid> <Ed>ed.burton@example.com</Ed> </customer> <customer> <customerid>9</customerid> <Jack>jack.woo@example.com</Jack> </customer> <customer> <customerid>10</customerid> <Maria>maria.gonzales@example.com</Maria> </customer> </customers> http://cvs.php.net/viewvc.cgi/pear/XML_Query2XML/tests/XML_Query2XML/MDB2/getXML/dynamicRowTag_columnName_onRootLevel.phpt?view=markup&rev=1.1 Index: pear/XML_Query2XML/tests/XML_Query2XML/MDB2/getXML/dynamicRowTag_columnName_onRootLevel.phpt +++ pear/XML_Query2XML/tests/XML_Query2XML/MDB2/getXML/dynamicRowTag_columnName_onRootLevel.phpt --TEST-- XML_Query2XML::getXML(): dynamicRowTag: COLUMN NAME on root level --SKIPIF-- <?php require_once dirname(dirname(__FILE__)) . '/skipif.php'; ?> --FILE-- <?php require_once 'XML/Query2XML.php'; require_once dirname(dirname(__FILE__)) . '/db_init.php'; $query2xml = XML_Query2XML::factory($db); $dom = $query2xml->getXML( "SELECT * FROM customer", array( 'rootTag' => 'customers', 'idColumn' => 'customerid', 'dynamicRowTag' => 'first_name', 'value' => 'email' ) ); header('Content-Type: application/xml'); $dom->formatOutput = true; print $dom->saveXML(); ?> --EXPECT-- <?xml version="1.0" encoding="UTF-8"?> <customers> <Jane>jane.doe@example.com</Jane> <John>john.doe@example.com</John> <Susan>susan.green@example.com</Susan> <Victoria>victory.alt@example.com</Victoria> <Will>will.wippy@example.com</Will> <Tim>tim.raw@example.com</Tim> <Nick>nick.fallow@example.com</Nick> <Ed>ed.burton@example.com</Ed> <Jack>jack.woo@example.com</Jack> <Maria>maria.gonzales@example.com</Maria> </customers> http://cvs.php.net/viewvc.cgi/pear/XML_Query2XML/tests/XML_Query2XML/MDB2/getXML/dynamicRowTag_commandObject.phpt?view=markup&rev=1.1 Index: pear/XML_Query2XML/tests/XML_Query2XML/MDB2/getXML/dynamicRowTag_commandObject.phpt +++ pear/XML_Query2XML/tests/XML_Query2XML/MDB2/getXML/dynamicRowTag_commandObject.phpt --TEST-- XML_Query2XML::getXML(): dynamicRowTag: COMMAND OBJECT --SKIPIF-- <?php require_once dirname(dirname(__FILE__)) . '/skipif.php'; ?> --FILE-- <?php require_once 'XML/Query2XML.php'; require_once 'XML/Query2XML/Callback.php'; require_once dirname(dirname(__FILE__)) . '/db_init.php'; class RowTagGenerator implements XML_Query2XML_Callback { public function execute(array $record) { return $record['last_name']; } } $query2xml = XML_Query2XML::factory($db); $dom = $query2xml->getXML( "SELECT * FROM customer", array( 'rootTag' => 'customers', 'idColumn' => 'customerid', 'rowTag' => 'customer', 'elements' => array( 'customerid', 'name_and_email' => array( 'dynamicRowTag' => new RowTagGenerator(), 'value' => 'email' ) ) ) ); header('Content-Type: application/xml'); $dom->formatOutput = true; print $dom->saveXML(); ?> --EXPECT-- <?xml version="1.0" encoding="UTF-8"?> <customers> <customer> <customerid>1</customerid> <Doe>jane.doe@example.com</Doe> </customer> <customer> <customerid>2</customerid> <Doe>john.doe@example.com</Doe> </customer> <customer> <customerid>3</customerid> <Green>susan.green@example.com</Green> </customer> <customer> <customerid>4</customerid> <Alt>victory.alt@example.com</Alt> </customer> <customer> <customerid>5</customerid> <Rippy>will.wippy@example.com</Rippy> </customer> <customer> <customerid>6</customerid> <Raw>tim.raw@example.com</Raw> </customer> <customer> <customerid>7</customerid> <Fallow>nick.fallow@example.com</Fallow> </customer> <customer> <customerid>8</customerid> <Burton>ed.burton@example.com</Burton> </customer> <customer> <customerid>9</customerid> <Woo>jack.woo@example.com</Woo> </customer> <customer> <customerid>10</customerid> <Gonzales>maria.gonzales@example.com</Gonzales> </customer> </customers> http://cvs.php.net/viewvc.cgi/pear/XML_Query2XML/tests/XML_Query2XML/MDB2/getXML/dynamicRowTag_staticString.phpt?view=markup&rev=1.1 Index: pear/XML_Query2XML/tests/XML_Query2XML/MDB2/getXML/dynamicRowTag_staticString.phpt +++ pear/XML_Query2XML/tests/XML_Query2XML/MDB2/getXML/dynamicRowTag_staticString.phpt --TEST-- XML_Query2XML::getXML(): dynamicRowTag: static string --SKIPIF-- <?php require_once dirname(dirname(__FILE__)) . '/skipif.php'; ?> --FILE-- <?php require_once 'XML/Query2XML.php'; require_once dirname(dirname(__FILE__)) . '/db_init.php'; $query2xml = XML_Query2XML::factory($db); $dom = $query2xml->getXML( "SELECT * FROM customer", array( 'rootTag' => 'customers', 'idColumn' => 'customerid', 'rowTag' => 'customer', 'elements' => array( 'customerid', 'name_and_email' => array( 'dynamicRowTag' => ':email', 'value' => 'email' ) ) ) ); header('Content-Type: application/xml'); $dom->formatOutput = true; print $dom->saveXML(); ?> --EXPECT-- <?xml version="1.0" encoding="UTF-8"?> <customers> <customer> <customerid>1</customerid> <email>jane.doe@example.com</email> </customer> <customer> <customerid>2</customerid> <email>john.doe@example.com</email> </customer> <customer> <customerid>3</customerid> <email>susan.green@example.com</email> </customer> <customer> <customerid>4</customerid> <email>victory.alt@example.com</email> </customer> <customer> <customerid>5</customerid> <email>will.wippy@example.com</email> </customer> <customer> <customerid>6</customerid> <email>tim.raw@example.com</email> </customer> <customer> <customerid>7</customerid> <email>nick.fallow@example.com</email> </customer> <customer> <customerid>8</customerid> <email>ed.burton@example.com</email> </customer> <customer> <customerid>9</customerid> <email>jack.woo@example.com</email> </customer> <customer> <customerid>10</customerid> <email>maria.gonzales@example.com</email> </customer> </customers>