cvs: php-src /ext/simplexml/tests 001.phpt 002.phpt sxe.dtd sxe.ent sxe.xml

From: Date: Sat, 25 Oct 2003 20:00:42 +0000
Subject: cvs: php-src /ext/simplexml/tests 001.phpt 002.phpt sxe.dtd sxe.ent sxe.xml
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-24248@lists.php.net to get a copy of this message
helly Sat Oct 25 16:00:42 2003 EDT Added files: /php-src/ext/simplexml/tests sxe.dtd sxe.ent sxe.xml Modified files: /php-src/ext/simplexml/tests 002.phpt 001.phpt Log: Add some testing Index: php-src/ext/simplexml/tests/002.phpt diff -u /dev/null php-src/ext/simplexml/tests/002.phpt:1.3 --- /dev/null Sat Oct 25 16:00:40 2003 +++ php-src/ext/simplexml/tests/002.phpt Sat Oct 25 16:00:04 2003 @@ -0,0 +1,50 @@ +--TEST-- +SimpleXML and clone +--SKIPIF-- +<?php if (!extension_loaded("simplexml")) print "skip"; ?> +--FILE-- +<?php + +$sxe = simplexml_load_file(dirname(__FILE__).'/sxe.xml'); + +$copy = $sxe->__clone; + +print_r($copy); + +echo "---Done---\n"; + +?> +--EXPECT-- +simplexml_element Object +( + [elem1] => simplexml_element Object + ( + [comment] => simplexml_element Object + ( + ) + + [elem2] => simplexml_element Object + ( + [elem3] => simplexml_element Object + ( + [included-entity] => simplexml_element Object + ( + [included-entity] => This is text included from an entity + ) + + [elem4] => simplexml_element Object + ( + [test] => simplexml_element Object + ( + ) + + ) + + ) + + ) + + ) + +) +---Done--- Index: php-src/ext/simplexml/tests/001.phpt diff -u php-src/ext/simplexml/tests/001.phpt:1.1 php-src/ext/simplexml/tests/001.phpt:1.2 --- php-src/ext/simplexml/tests/001.phpt:1.1 Sun May 18 16:33:26 2003 +++ php-src/ext/simplexml/tests/001.phpt Sat Oct 25 16:00:03 2003 @@ -1,24 +1,48 @@ --TEST-- -Check for simplexml presence +SimpleXML without CDATA --SKIPIF-- <?php if (!extension_loaded("simplexml")) print "skip"; ?> ---POST-- ---GET-- ---INI-- --FILE-- <?php -echo "simplexml extension is available"; -/* - you can add regression tests for your extension here - - the output of your test code has to be equal to the - text in the --EXPECT-- section below for the tests - to pass, differences between the output and the - expected text are interpreted as failure - - see php4/README.TESTING for further information on - writing regression tests -*/ + +$sxe = simplexml_load_file(dirname(__FILE__).'/sxe.xml'); + +print_r($sxe); + +echo "---Done---\n"; + ?> --EXPECT-- -simplexml extension is available +simplexml_element Object +( + [elem1] => simplexml_element Object + ( + [comment] => simplexml_element Object + ( + ) + + [elem2] => simplexml_element Object + ( + [elem3] => simplexml_element Object + ( + [included-entity] => simplexml_element Object + ( + [included-entity] => This is text included from an entity + ) + + [elem4] => simplexml_element Object + ( + [test] => simplexml_element Object + ( + ) + + ) + + ) + + ) + + ) + +) +---Done--- Index: php-src/ext/simplexml/tests/sxe.dtd +++ php-src/ext/simplexml/tests/sxe.dtd <?xml encoding='US-ASCII'?> <!ELEMENT sxe elem1> <!ATTLIST sxe id> <!ELEMENT elem1 elem2> <!ATTLIST elem1 attr1 CDATA #required attr2 CDATA "default> <!ELEMENT elem2 elem3> <!ATTLIST elem2> <!ELEMENT elem3 elem4> <!ATTLIST elem3> <!ELEMENT elem4 EMPTY> <!ATTLIST elem4> Index: php-src/ext/simplexml/tests/sxe.ent +++ php-src/ext/simplexml/tests/sxe.ent <!ENTITY included-entity "This is text included from an entity"> Index: php-src/ext/simplexml/tests/sxe.xml +++ php-src/ext/simplexml/tests/sxe.xml <?xml version='1.0'?> <!DOCTYPE sxe SYSTEM "notfound.dtd" [ <!ENTITY % incent SYSTEM "sxe.ent"> %incent; ]> <sxe id="elem1"> Plain text. <elem1 attr1='first'> <!-- comment --> <elem2> <elem3> &included-entity; <elem4> <?test processing instruction ?> </elem4> </elem3> </elem2> </elem1> </sxe>

« previous php.cvs (#24248) next »