]> granicus.if.org Git - php/commitdiff
added test for property_exists checks.
authorGeorge Schlossnagle <gschlossnagle@php.net>
Wed, 24 Mar 2004 15:20:32 +0000 (15:20 +0000)
committerGeorge Schlossnagle <gschlossnagle@php.net>
Wed, 24 Mar 2004 15:20:32 +0000 (15:20 +0000)
ext/simplexml/tests/021.phpt [new file with mode: 0644]

diff --git a/ext/simplexml/tests/021.phpt b/ext/simplexml/tests/021.phpt
new file mode 100644 (file)
index 0000000..e58e26d
--- /dev/null
@@ -0,0 +1,25 @@
+--TEST--
+SimpleXML element check
+--SKIPIF--
+<?php if (!extension_loaded("simplexml")) print "skip"; ?> 
+--FILE--
+<?php
+
+$ok = 1;
+$doc = simplexml_load_string('<root><exists>foo</exists></root>');
+if(!isset($doc->exists)) {
+       $ok *= 0;
+}
+if(isset($doc->doesnotexist)) {
+       $ok *= 0;
+}
+if ($ok) {
+         print "Works\n";
+} else {
+         print "Error\n";
+}
+?>
+===DONE===
+--EXPECT--
+Works
+===DONE===