<?php
/**
* Testing rig for XMLThing
*
*/
require_once('simpletest/unit_tester.php');
require_once('simpletest/reporter.php');
require_once('xml-test-data.php');
require_once("xmlthing.class.php");
/**
*
*/
class Test_Case extends UnitTestCase
{
function testOne()
{
global $xml1, $xmlbasic, $xmlphoto, $xmltiny;
$xml = new XMLThing($xmlphoto);
$data = $xml->parse();
$this->assertTrue(is_array($data));
echo 'TRANSLATED<pre>'.print_r($data, 1).'</pre>';
echo '<table><tr valign="top">';
echo '<td>KEY ARRAY:<pre>'.print_r($xml->keyArray, 1).'</pre></td>';
echo '<td>VALUE ARRAY:<pre>'.print_r($xml->valueArray, 1).'</pre></td>';
echo '</tr></table>';
}
}
// run only if this file is directly called
if (__FILE__ == realpath($_SERVER['SCRIPT_FILENAME']))
{
$test = new Test_Case('Test My XML Stuff');
$test->run(new HTMLReporter);
highlight_file(__FILE__);
}
?>
|