File:  [ELWIX - Embedded LightWeight unIX -] / embedaddon / php / ext / xmlwriter / tests / 010.phpt
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs - revision graph
Tue Feb 21 23:48:05 2012 UTC (12 years, 8 months ago) by misho
Branches: php, MAIN
CVS tags: v5_4_3elwix, v5_4_29p0, v5_4_29, v5_4_20p0, v5_4_20, v5_4_17p0, v5_4_17, v5_3_10, HEAD
php

--TEST--
xmlwriter_start/end_attribute()
--SKIPIF--
<?php 
if (!extension_loaded("xmlwriter")) die("skip"); 
?>
--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

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>