cvs: pear /XML_Serializer Serializer.php package.php /XML_Serializer/tests Serializer_Option_DocType_TestCase.php run-tests.php
| From: | Stephan Schmidt | Date: | Tue, 04 Oct 2005 18:35:18 +0000 |
| Subject: | cvs: pear /XML_Serializer Serializer.php package.php /XML_Serializer/tests Serializer_Option_DocType_TestCase.php run-tests.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-35266@lists.php.net to get a copy of this message | ||
schst Tue Oct 4 14:35:18 2005 EDT
Added files:
/pear/XML_Serializer/tests Serializer_Option_DocType_TestCase.php
Modified files:
/pear/XML_Serializer Serializer.php package.php
/pear/XML_Serializer/tests run-tests.php
Log:
Fixed bug with doctype declaration (tag name is missing), added unit test for DTD feature
http://cvs.php.net/diff.php/pear/XML_Serializer/Serializer.php?r1=1.47&r2=1.48&ty=u
Index: pear/XML_Serializer/Serializer.php
diff -u pear/XML_Serializer/Serializer.php:1.47 pear/XML_Serializer/Serializer.php:1.48
--- pear/XML_Serializer/Serializer.php:1.47 Fri Sep 30 09:40:30 2005
+++ pear/XML_Serializer/Serializer.php Tue Oct 4 14:35:16 2005
@@ -19,7 +19,7 @@
* @author Stephan Schmidt <schst@php.net>
* @copyright 1997-2005 The PHP Group
* @license http://www.php.net/license/3_0.txt
PHP License 3.0
- * @version CVS: $Id: Serializer.php,v 1.47 2005/09/30 13:40:30 schst Exp $
+ * @version CVS: $Id: Serializer.php,v 1.48 2005/10/04 18:35:16 schst Exp $
* @link http://pear.php.net/package/XML_Serializer
* @see XML_Unserializer
*/
@@ -615,7 +615,7 @@
// add doctype declaration
if ($this->options[XML_SERIALIZER_OPTION_DOCTYPE_ENABLED] === true) {
- $this->_serializedData = XML_Util::getDoctypeDeclaration($tagName,
$this->options[XML_SERIALIZER_OPTION_DOCTYPE])
+ $this->_serializedData = XML_Util::getDoctypeDeclaration($tag['qname'],
$this->options[XML_SERIALIZER_OPTION_DOCTYPE])
. $this->options[XML_SERIALIZER_OPTION_LINEBREAKS]
. $this->_serializedData;
}
http://cvs.php.net/diff.php/pear/XML_Serializer/package.php?r1=1.29&r2=1.30&ty=u
Index: pear/XML_Serializer/package.php
diff -u pear/XML_Serializer/package.php:1.29 pear/XML_Serializer/package.php:1.30
--- pear/XML_Serializer/package.php:1.29 Sun Oct 2 13:52:50 2005
+++ pear/XML_Serializer/package.php Tue Oct 4 14:35:16 2005
@@ -3,7 +3,7 @@
* script to automate the generation of the
* package.xml file.
*
- * $Id: package.php,v 1.29 2005/10/02 17:52:50 schst Exp $
+ * $Id: package.php,v 1.30 2005/10/04 18:35:16 schst Exp $
*
* @author Stephan Schmidt <schst@php-tools.net>
* @package XML_Serializer
@@ -18,7 +18,7 @@
/**
* current version
*/
-$version = '0.18.0';
+$version = '1.0.0RC1';
/**
* current state
@@ -30,13 +30,9 @@
*/
$notes = <<<EOT
XML_Serializer:
-- Allow the use of '#default' whenever one wants to specify an option for any other key
-- fixed bug #4575 for real: XML_Serializer now expects __sleep() to return an array of property
names
+- fixed bug with doctype declaration (root tag has not been included)
+- Added unit tests for all features
XML_Unserializer:
-- Added new IGNORE_KEYS option to specify a list of tags which will not be unserialized using their
names as keys
-- Added new GUESS_TYPE option to automatically convert the data to the best matching type
-- Allow COMPLEXTYPE to be an array to be able to unserialize to arrays or objects
-- Allow the use of '#default' whenever one wants to specify an option for any other tag
EOT;
/**
http://cvs.php.net/diff.php/pear/XML_Serializer/tests/run-tests.php?r1=1.4&r2=1.5&ty=u
Index: pear/XML_Serializer/tests/run-tests.php
diff -u pear/XML_Serializer/tests/run-tests.php:1.4 pear/XML_Serializer/tests/run-tests.php:1.5
--- pear/XML_Serializer/tests/run-tests.php:1.4 Tue Oct 4 14:28:31 2005
+++ pear/XML_Serializer/tests/run-tests.php Tue Oct 4 14:35:18 2005
@@ -2,7 +2,7 @@
/**
* Unit tests for XML_Serializer package
*
- * $Id: run-tests.php,v 1.4 2005/10/04 18:28:31 schst Exp $
+ * $Id: run-tests.php,v 1.5 2005/10/04 18:35:18 schst Exp $
*
* @package XML_Serializer
* @subpackage Tests
@@ -25,6 +25,7 @@
'Serializer_Option_RootName_TestCase',
'Serializer_Option_RootAttributes_TestCase',
'Serializer_Option_XmlDeclaration_TestCase',
+ 'Serializer_Option_DocType_TestCase',
'Serializer_Option_DefaultTag_TestCase',
'Serializer_Option_ClassName_TestCase',
'Serializer_Option_TypeHints_TestCase'
http://cvs.php.net/co.php/pear/XML_Serializer/tests/Serializer_Option_DocType_TestCase.php?r=1.1&p=1
Index: pear/XML_Serializer/tests/Serializer_Option_DocType_TestCase.php
+++ pear/XML_Serializer/tests/Serializer_Option_DocType_TestCase.php
<?php
/**
* Testcase for adding an doctype declaration
*
* @author Stephan Schmidt <schst@php-tools.net>
* @package XML_Serializer
* @subpackage Tests
*/
class Serializer_Option_DocType_TestCase extends PHPUnit_TestCase
{
var $options = array(
XML_SERIALIZER_OPTION_LINEBREAKS => '',
XML_SERIALIZER_OPTION_INDENT => '',
);
function Serializer_Option_DocType_TestCase($name)
{
$this->PHPUnit_TestCase($name);
}
/**
* Declaration
*/
function testDeclaration()
{
$s = new XML_Serializer($this->options);
$s->setOption(XML_SERIALIZER_OPTION_DOCTYPE_ENABLED, true);
$s->serialize('string');
$this->assertEquals('<!DOCTYPE
string><string>string</string>', $s->getSerializedData());
}
/**
* Declaration
*/
function testSystem()
{
$s = new XML_Serializer($this->options);
$s->setOption(XML_SERIALIZER_OPTION_DOCTYPE_ENABLED, true);
$s->setOption(XML_SERIALIZER_OPTION_DOCTYPE, '/path/to/doctype.dtd');
$s->serialize('string');
$this->assertEquals('<!DOCTYPE string SYSTEM
"/path/to/doctype.dtd"><string>string</string>',
$s->getSerializedData());
}
}