* @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_XmlDeclaration_TestCase extends PHPUnit_Framework_TestCase { private $options = array( XML_SERIALIZER_OPTION_INDENT => '', XML_SERIALIZER_OPTION_LINEBREAKS => '', ); /** * Declaration */ public function testDeclaration() { $s = new XML_Serializer($this->options); $s->setOption(XML_SERIALIZER_OPTION_XML_DECL_ENABLED, true); $s->serialize('string'); $this->assertEquals('string', $s->getSerializedData()); } /** * Add encoding */ public function testEncoding() { $s = new XML_Serializer($this->options); $s->setOption(XML_SERIALIZER_OPTION_XML_DECL_ENABLED, true); $s->setOption(XML_SERIALIZER_OPTION_XML_ENCODING, 'ISO-8859-1'); $s->serialize('string'); $this->assertEquals('string', $s->getSerializedData()); } } ?>