diff options
Diffstat (limited to 'ext/dom/tests')
| -rwxr-xr-x | ext/dom/tests/DOMAttr_value_basic_001.phpt | 5 | ||||
| -rwxr-xr-x | ext/dom/tests/DOMCharacterData_length_error_001.phpt | 7 | ||||
| -rw-r--r-- | ext/dom/tests/DOMText_appendData_basic.phpt | 7 | ||||
| -rw-r--r-- | ext/dom/tests/bug42082.phpt | 7 | ||||
| -rw-r--r-- | ext/dom/tests/bug47848.phpt | 25 | ||||
| -rw-r--r-- | ext/dom/tests/bug49463.phpt | 17 | ||||
| -rw-r--r-- | ext/dom/tests/bug50661.phpt | 16 | ||||
| -rw-r--r-- | ext/dom/tests/domdocument_createcomment_error_001.phpt | 7 | ||||
| -rw-r--r-- | ext/dom/tests/domdocument_createentityreference_001.phpt | 9 | ||||
| -rw-r--r-- | ext/dom/tests/domdocument_createentityreference_002.phpt | 7 |
10 files changed, 100 insertions, 7 deletions
diff --git a/ext/dom/tests/DOMAttr_value_basic_001.phpt b/ext/dom/tests/DOMAttr_value_basic_001.phpt index 2a2b52121..40e00bcc4 100755 --- a/ext/dom/tests/DOMAttr_value_basic_001.phpt +++ b/ext/dom/tests/DOMAttr_value_basic_001.phpt @@ -3,9 +3,14 @@ Read empty $value. --CREDIT-- Jason Bouffard <jbouffard1@yahoo.com> # TestFest Atlanta 2009-05-14 +--SKIPIF-- +<?php require_once('skipif.inc'); ?> --FILE-- <?php $attr = new DOMAttr('category'); print $attr->value."\n"; ?> +===DONE=== --EXPECTF-- +===DONE=== +
\ No newline at end of file diff --git a/ext/dom/tests/DOMCharacterData_length_error_001.phpt b/ext/dom/tests/DOMCharacterData_length_error_001.phpt index 87c9377b3..0dda492ad 100755 --- a/ext/dom/tests/DOMCharacterData_length_error_001.phpt +++ b/ext/dom/tests/DOMCharacterData_length_error_001.phpt @@ -3,10 +3,15 @@ Invalid State Error when getting length on DOMCharacterData out of content. --CREDIT-- Jason Bouffard <jbouffard1@yahoo.com> # TestFest Atlanta 2009-05-14 +--SKIPIF-- +<?php require_once('skipif.inc'); ?> --FILE-- <?php $character_data = new DOMCharacterData(); print $character_data->length; ?> +===DONE=== --EXPECTF-- -Warning: main(): Invalid State Error in %s
\ No newline at end of file +Warning: main(): Invalid State Error in %s +===DONE=== +
\ No newline at end of file diff --git a/ext/dom/tests/DOMText_appendData_basic.phpt b/ext/dom/tests/DOMText_appendData_basic.phpt index 6a28a9ae4..0eea699a7 100644 --- a/ext/dom/tests/DOMText_appendData_basic.phpt +++ b/ext/dom/tests/DOMText_appendData_basic.phpt @@ -3,6 +3,8 @@ DOMText::appendData basic functionality test --CREDITS-- Mike Sullivan <mike@regexia.com> #TestFest 2008 (London) +--SKIPIF-- +<?php require_once('skipif.inc'); ?> --FILE-- <?php @@ -26,10 +28,13 @@ echo "Text Content: " . $textnode->data . "\n"; echo "\n" . $document->saveXML(); ?> +===DONE=== --EXPECT-- Text Length (one append): 4 Text Length (two appends): 8 Text Content: data><&" <?xml version="1.0"?> -<root><text>data><&"</text></root>
\ No newline at end of file +<root><text>data><&"</text></root> +===DONE=== +
\ No newline at end of file diff --git a/ext/dom/tests/bug42082.phpt b/ext/dom/tests/bug42082.phpt index 86f32dd8d..ab018a777 100644 --- a/ext/dom/tests/bug42082.phpt +++ b/ext/dom/tests/bug42082.phpt @@ -1,5 +1,7 @@ --TEST-- Bug #42082 (NodeList length zero should be empty) +--SKIPIF-- +<?php require_once('skipif.inc'); ?> --FILE-- <?php $doc = new DOMDocument(); @@ -14,6 +16,7 @@ $doc->loadXML("<element></element>"); var_dump($doc->firstChild->nodeValue, empty($doc->firstChild->nodeValue), isset($doc->firstChild->nodeValue)); var_dump(empty($doc->nodeType), empty($doc->firstChild->nodeType)) ?> +===DONE=== --EXPECTF-- object(DOMNodeList)#%d (0) { } @@ -24,4 +27,6 @@ string(0) "" bool(true) bool(true) bool(false) -bool(false)
\ No newline at end of file +bool(false) +===DONE=== +
\ No newline at end of file diff --git a/ext/dom/tests/bug47848.phpt b/ext/dom/tests/bug47848.phpt new file mode 100644 index 000000000..b4453c720 --- /dev/null +++ b/ext/dom/tests/bug47848.phpt @@ -0,0 +1,25 @@ +--TEST-- +Bug #47848 (importNode doesn't preserve attribute namespaces) +--SKIPIF-- +<?php require_once('skipif.inc'); ?> +--FILE-- +<?php + +$aDOM = new DOMDocument(); +$aDOM->appendChild($aDOM->createElementNS('http://friend2friend.net/','f2f:a')); + +$fromdom = new DOMDocument(); +$fromdom->loadXML('<data xmlns:ai="http://altruists.org" ai:attr="namespaced" />'); + +$attr= $fromdom->firstChild->attributes->item(0); + +$att = $aDOM->importNode($attr); + +$aDOM->documentElement->appendChild($aDOM->importNode($attr, true)); + +echo $aDOM->saveXML(); + +?> +--EXPECT-- +<?xml version="1.0"?> +<f2f:a xmlns:f2f="http://friend2friend.net/" xmlns:ai="http://altruists.org" ai:attr="namespaced"/>
\ No newline at end of file diff --git a/ext/dom/tests/bug49463.phpt b/ext/dom/tests/bug49463.phpt new file mode 100644 index 000000000..4f232e3b3 --- /dev/null +++ b/ext/dom/tests/bug49463.phpt @@ -0,0 +1,17 @@ +--TEST-- +Bug #49463 (setAttributeNS fails setting default namespace). +--SKIPIF-- +<?php require_once('skipif.inc'); ?> +--FILE-- +<?php + +$doc = new DOMDocument('1.0', 'utf-8'); +$root = $doc->createElementNS('http://purl.org/rss/1.0/','rdf:RDF'); +$doc->appendChild($root); +$root->setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns","http://purl.org/rss/1.0/" ); + +echo $doc->saveXML()."\n"; +?> +--EXPECT-- +<?xml version="1.0" encoding="utf-8"?> +<rdf:RDF xmlns:rdf="http://purl.org/rss/1.0/" xmlns="http://purl.org/rss/1.0/"/> diff --git a/ext/dom/tests/bug50661.phpt b/ext/dom/tests/bug50661.phpt new file mode 100644 index 000000000..3760db9b4 --- /dev/null +++ b/ext/dom/tests/bug50661.phpt @@ -0,0 +1,16 @@ +--TEST-- +Bug #50661 (DOMDocument::loadXML does not allow UTF-16). +--SKIPIF-- +<?php require_once('skipif.inc'); ?> +--FILE-- +<?php +$data = "\xFE\xFF\x00\x3C\x00\x66\x00\x6F\x00\x6F\x00\x2F\x00\x3E"; + +$dom = new DOMDocument(); +$dom->loadXML($data); +echo $dom->saveXML(); + +?> +--EXPECT-- +<?xml version="1.0"?> +<foo/> diff --git a/ext/dom/tests/domdocument_createcomment_error_001.phpt b/ext/dom/tests/domdocument_createcomment_error_001.phpt index 5df4e2047..24104a1a0 100644 --- a/ext/dom/tests/domdocument_createcomment_error_001.phpt +++ b/ext/dom/tests/domdocument_createcomment_error_001.phpt @@ -2,10 +2,15 @@ DomDocument::CreateComment() - Incorrect Parameters --CREDITS-- Clint Priest @ PhpTek09 +--SKIPIF-- +<?php require_once('skipif.inc'); ?> --FILE-- <?php $x = new DomDocument(); $x->createComment(); ?> +===DONE=== --EXPECTF-- -Warning: DOMDocument::createComment() expects exactly 1 parameter, 0 given in %s
\ No newline at end of file +Warning: DOMDocument::createComment() expects exactly 1 parameter, 0 given in %s +===DONE=== +
\ No newline at end of file diff --git a/ext/dom/tests/domdocument_createentityreference_001.phpt b/ext/dom/tests/domdocument_createentityreference_001.phpt index 15f7df188..7343e74cf 100644 --- a/ext/dom/tests/domdocument_createentityreference_001.phpt +++ b/ext/dom/tests/domdocument_createentityreference_001.phpt @@ -2,12 +2,17 @@ DomDocument::CreateEntityReference() - Creates an entity reference with the appropriate name --CREDITS-- Clint Priest @ PhpTek09 +--SKIPIF-- +<?php require_once('skipif.inc'); ?> --FILE-- <?php $objDoc = new DomDocument(); $objRef = $objDoc->createEntityReference('Test'); - echo $objRef->nodeName; + echo $objRef->nodeName . "\n"; ?> +===DONE=== --EXPECT-- -Test
\ No newline at end of file +Test +===DONE=== +
\ No newline at end of file diff --git a/ext/dom/tests/domdocument_createentityreference_002.phpt b/ext/dom/tests/domdocument_createentityreference_002.phpt index 21d79aa4b..a2416c2d8 100644 --- a/ext/dom/tests/domdocument_createentityreference_002.phpt +++ b/ext/dom/tests/domdocument_createentityreference_002.phpt @@ -2,11 +2,16 @@ DomDocument::CreateEntityReference() - Empty Arguments --CREDITS-- Clint Priest @ PhpTek09 +--SKIPIF-- +<?php require_once('skipif.inc'); ?> --FILE-- <?php $objDoc = new DomDocument(); $objRef = $objDoc->createEntityReference(); ?> +===DONE=== --EXPECTF-- -Warning: DOMDocument::createEntityReference() expects exactly 1 parameter, 0 given in %s
\ No newline at end of file +Warning: DOMDocument::createEntityReference() expects exactly 1 parameter, 0 given in %s +===DONE=== +
\ No newline at end of file |
