pickles/tests/classes/ConvertTest.php
Joshua Sherman 7f37abc527 Cleaned up test includes a bit
Probably want to include an autoloader at some point. Also added PHP 5.3 and 5.4 to the test list, 5.3 outta fail, unsure about 5.4
2013-12-29 13:16:21 -05:00

26 lines
955 B
PHP

<?php
class ConvertTest extends PHPUnit_Framework_TestCase
{
/**
* @dataProvider providerArrayToXML
*/
public function testArrayToXML($a, $b, $c)
{
$this->assertEquals(Convert::arrayToXML($a, $b), $c);
}
public function providerArrayToXML()
{
return array(
array('foo', false, ''),
array(array('foo', 'bar'), false, '<0>foo</0><1>bar</1>'),
array(array('foo', 'bar'), true, "<0>foo</0>\n<1>bar</1>\n"),
array(array('foo' => 'bar'), false, '<foo>bar</foo>'),
array(array('children' => array('child' => array('foo', 'bar'))), false, '<children><child>foo</child><child>bar</child></children>'),
array(array('children' => array('child' => array('foo', 'bar'))), true, "<children>\n\t<child>foo</child>\n\t<child>bar</child>\n</children>\n"),
);
}
}
?>