summaryrefslogtreecommitdiff
path: root/ext/xmlwriter
diff options
context:
space:
mode:
authorAntony Dovgal <tony2001@php.net>2006-07-11 16:33:25 (GMT)
committerAntony Dovgal <tony2001@php.net>2006-07-11 16:33:25 (GMT)
commit24d3381b1012f996766821986a4a1532147a37f6 (patch)
tree77595ee2ccad8b921d973999da7db93c4c762d2f /ext/xmlwriter
parenta602a3eef5ac05ef7dba72c9f922bfed9c1295e5 (diff)
downloadphp-24d3381b1012f996766821986a4a1532147a37f6.tar.gz
fix typo, add new test
Diffstat (limited to 'ext/xmlwriter')
-rw-r--r--ext/xmlwriter/php_xmlwriter.c2
-rw-r--r--ext/xmlwriter/tests/010.phpt41
2 files changed, 42 insertions, 1 deletions
diff --git a/ext/xmlwriter/php_xmlwriter.c b/ext/xmlwriter/php_xmlwriter.c
index fe76a0b..5628b2c 100644
--- a/ext/xmlwriter/php_xmlwriter.c
+++ b/ext/xmlwriter/php_xmlwriter.c
@@ -116,7 +116,7 @@ PHP_XMLWRITER_API zend_object_value xmlwriter_object_new(zend_class_entry *class
#define XMLW_NAME_CHK(__err) \
if (xmlValidateName((xmlChar *) name, 0) != 0) { \
- php_error_docref(NULL TSRMLS_CC, E_WARNING, #__err); \
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, __err); \
RETURN_FALSE; \
} \
diff --git a/ext/xmlwriter/tests/010.phpt b/ext/xmlwriter/tests/010.phpt
new file mode 100644
index 0000000..89439dc
--- /dev/null
+++ b/ext/xmlwriter/tests/010.phpt
@@ -0,0 +1,41 @@
+--TEST--
+xmlwriter_start/end_attribute()
+--FILE--
+<?php
+
+$file = dirname(__FILE__).'/010.tmp';
+
+$xw = xmlwriter_open_uri($file);
+
+var_dump(xmlwriter_start_element($xw, "tag"));
+var_dump(xmlwriter_start_attribute($xw, "attr"));
+var_dump(xmlwriter_end_attribute($xw));
+var_dump(xmlwriter_start_attribute($xw, "-1"));
+var_dump(xmlwriter_end_attribute($xw));
+var_dump(xmlwriter_start_attribute($xw, "\""));
+var_dump(xmlwriter_end_attribute($xw));
+var_dump(xmlwriter_end_element($xw));
+
+unset($xw);
+
+var_dump(file_get_contents($file));
+
+@unlink($file);
+
+echo "Done\n";
+?>
+--EXPECTF--
+bool(true)
+bool(true)
+bool(true)
+
+Warning: xmlwriter_start_attribute(): Invalid Attribute Name in %s on line %d
+bool(false)
+bool(false)
+
+Warning: xmlwriter_start_attribute(): Invalid Attribute Name in %s on line %d
+bool(false)
+bool(false)
+bool(true)
+string(14) "<tag attr=""/>"
+Done