]> granicus.if.org Git - php/commitdiff
Add new test
authorMarcus Boerger <helly@php.net>
Sun, 14 Mar 2004 15:33:15 +0000 (15:33 +0000)
committerMarcus Boerger <helly@php.net>
Sun, 14 Mar 2004 15:33:15 +0000 (15:33 +0000)
ext/simplexml/tests/020.phpt [new file with mode: 0755]

diff --git a/ext/simplexml/tests/020.phpt b/ext/simplexml/tests/020.phpt
new file mode 100755 (executable)
index 0000000..a2a3287
--- /dev/null
@@ -0,0 +1,21 @@
+--TEST--
+SimpleXML attribute compared to string
+--SKIPIF--
+<?php if (!extension_loaded("simplexml")) print "skip"; ?> 
+--FILE--
+<?php
+
+$doc = simplexml_load_string('<root><name attr="foo">bar</name></root>');
+print $doc->name["attr"];
+print "\n";
+if ($doc->name["attr"] == "foo") {
+         print "Works\n";
+} else {
+         print "Error\n";
+}
+?>
+===DONE===
+--EXPECT--
+foo
+Works
+===DONE===