cvs: php-src /ext/simplexml/tests 016a.phpt 022.phpt
| From: | Marcus Boerger | Date: | Sun, 27 Feb 2005 23:15:54 +0000 |
| Subject: | cvs: php-src /ext/simplexml/tests 016a.phpt 022.phpt | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-30628@lists.php.net to get a copy of this message | ||
helly Sun Feb 27 18:15:54 2005 EDT
Added files:
/php-src/ext/simplexml/tests 016a.phpt 022.phpt
Log:
- Add tests
http://cvs.php.net/co.php/php-src/ext/simplexml/tests/016a.phpt?r=1.1&p=1
Index: php-src/ext/simplexml/tests/016a.phpt
+++ php-src/ext/simplexml/tests/016a.phpt
--TEST--
SimpleXML: concatenating attributes
--SKIPIF--
<?php if (!extension_loaded("simplexml")) print "skip"; ?>
--FILE--
<?php
$xml =<<<EOF
<people>
<person name="Foo"></person>
</people>
EOF;
$people = simplexml_load_string($xml);
var_dump($people->person['name']);
$people->person['name'] .= 'Bar';
var_dump($people->person['name']);
?>
===DONE===
--EXPECTF--
object(SimpleXMLElement)#%d (1) {
[0]=>
string(3) "Foo"
}
object(SimpleXMLElement)#%d (1) {
[0]=>
string(6) "FooBar"
}
===DONE===
http://cvs.php.net/co.php/php-src/ext/simplexml/tests/022.phpt?r=1.1&p=1
Index: php-src/ext/simplexml/tests/022.phpt
+++ php-src/ext/simplexml/tests/022.phpt
--TEST--
SimpleXML and attributes inside foreach
--SKIPIF--
<?php if (!extension_loaded("simplexml")) print "skip"; ?>
--FILE--
<?php
$xml =<<<EOF
<?xml version='1.0'?>
<pres><content><file glob="slide_*.xml"/></content></pres>
EOF;
$sxe = simplexml_load_string($xml);
foreach($sxe->content->file as $file)
{
var_dump($file);
var_dump($file['glob']);
}
?>
===DONE===
--EXPECTF--
object(SimpleXMLElement)#%d (0) {
}
object(SimpleXMLElement)#%d (1) {
[0]=>
string(11) "slide_*.xml"
}
===DONE===