summaryrefslogtreecommitdiff
path: root/ext/dom/tests/DOMDocument_schemaValidateSource_addAttrs.phpt
diff options
context:
space:
mode:
Diffstat (limited to 'ext/dom/tests/DOMDocument_schemaValidateSource_addAttrs.phpt')
-rw-r--r--ext/dom/tests/DOMDocument_schemaValidateSource_addAttrs.phpt25
1 files changed, 25 insertions, 0 deletions
diff --git a/ext/dom/tests/DOMDocument_schemaValidateSource_addAttrs.phpt b/ext/dom/tests/DOMDocument_schemaValidateSource_addAttrs.phpt
new file mode 100644
index 0000000000..994b94d0c8
--- /dev/null
+++ b/ext/dom/tests/DOMDocument_schemaValidateSource_addAttrs.phpt
@@ -0,0 +1,25 @@
+--TEST--
+DomDocument::schemaValidateSource() - Add missing attribute default values from schema
+--CREDITS--
+Chris Wright <info@daverandom.com>
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+
+$doc = new DOMDocument;
+
+$doc->load(dirname(__FILE__)."/book-attr.xml");
+
+$xsd = file_get_contents(dirname(__FILE__)."/book.xsd");
+
+$doc->schemaValidateSource($xsd, LIBXML_SCHEMA_CREATE);
+
+foreach ($doc->getElementsByTagName('book') as $book) {
+ var_dump($book->getAttribute('is-hardback'));
+}
+
+?>
+--EXPECT--
+string(5) "false"
+string(4) "true"