* @author Chuck Burgess */ require_once 'XML/Serializer.php'; /** * Unit Tests for serializing arrays * * @package XML_Serializer * @subpackage tests * @author Stephan Schmidt * @author Chuck Burgess */ class XML_Serializer_Option_Mode_TestCase extends PHPUnit_Framework_TestCase { private $options = array( XML_SERIALIZER_OPTION_INDENT => '', XML_SERIALIZER_OPTION_LINEBREAKS => '', ); /** * Default mode */ public function testDefault() { $s = new XML_Serializer($this->options); $s->serialize(array('foo' => array(1, 2, 3), 'bar' => array(1, 2, 3))); $this->assertEquals('123123', $s->getSerializedData()); } /** * SimpleXML */ public function testSimpleXML() { $s = new XML_Serializer($this->options); $s->setOption(XML_SERIALIZER_OPTION_MODE, XML_SERIALIZER_MODE_SIMPLEXML); $s->serialize(array('foo' => array(1, 2, 3), 'bar' => array(1, 2, 3))); $this->assertEquals('123123', $s->getSerializedData()); } } ?>