1
0
mirror of https://github.com/php/php-src.git synced 2026-04-25 17:08:14 +02:00

New test: DOMAttr read $name property.

New test: DOMAttr read $ownerElement with null parent.
New test: DOMAttr write non-string $value property
New test: DOMCDATASection __construct() with no arguments.
New test: DOMCharacterData - Invalid State Error when getting data out of content.
This commit is contained in:
Eric Stewart
2009-05-23 01:43:48 +00:00
parent 9f6c828f63
commit 39d82c35c3
5 changed files with 87 additions and 0 deletions
+14
View File
@@ -0,0 +1,14 @@
--TEST--
DOMAttr read $name property.
--CREDITS--
Nic Rosental <nicrosental@gmail.com>
# TestFest Atlanta 2009-05-14
--SKIPIF--
<?php require_once('skipif.inc'); ?>
--FILE--
<?php
$attr = new DOMAttr('category', 'books');
print $attr->name;
?>
--EXPECT--
category
+23
View File
@@ -0,0 +1,23 @@
--TEST--
Read $ownerElement with null parent.
--CREDITS--
Travis Pew
# TestFest Atlanta 2009-05-14
--SKIPIF--
<?php require_once('skipif.inc'); ?>
--FILE--
<?php
$document = new DOMDocument;
$root = $document->createElement('root');
$document->appendChild($root);
$attr = $root->setAttribute('category', 'books');
$document->removeChild($root);
$root = null;
var_dump($attr->ownerElement);
?>
--EXPECTF--
Warning: Couldn't fetch DOMAttr. Node no longer exists in %s on line %d
Notice: Undefined property: DOMAttr::$ownerElement in %s on line %d
NULL
@@ -0,0 +1,15 @@
--TEST--
Write non-string $value property
--CREDIT--
Eric Berg <ehberg@gmail.com>
# TestFest Atlanta 2009-05-14
--SKIPIF--
<?php require_once('skipif.inc'); ?>
--FILE--
<?php
$attr = new DOMAttr('category');
$attr->value = 1;
print $attr->value;
?>
--EXPECTF--
1
@@ -0,0 +1,21 @@
--TEST--
__construct() with no arguments.
--CREDITS--
Nic Rosental nicrosental@gmail.com
# TestFest Atlanta 2009-5-14
--SKIPIF--
<?php require_once('skipif.inc'); ?>
--FILE--
<?php
try
{
$section = new DOMCDataSection();
}
catch (Exception $e)
{
echo $e->getMessage();
}
?>
--EXPECT--
DOMCdataSection::__construct() expects exactly 1 parameter, 0 given
+14
View File
@@ -0,0 +1,14 @@
--TEST--
Invalid State Error when getting data on DOMCharacterData out of content.
--CREDIT--
Eric Berg <ehberg@gmail.com>
# TestFest Atlanta 2009-05-14
--SKIPIF--
<?php require_once('skipif.inc'); ?>
--FILE--
<?php
$character_data = new DOMCharacterData();
print $character_data->data;
?>
--EXPECTF--
Warning: main(): Invalid State Error in %s on line %d