From 39d82c35c3cb1ca4fabaa1ae7ae4e4e268382411 Mon Sep 17 00:00:00 2001 From: Eric Stewart Date: Sat, 23 May 2009 01:43:48 +0000 Subject: [PATCH] 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. --- ext/dom/tests/DOMAttr_name_basic_001.phpt | 14 +++++++++++ .../tests/DOMAttr_ownerElement_error_001.phpt | 23 +++++++++++++++++++ ext/dom/tests/DOMAttr_value_basic_002.phpt | 15 ++++++++++++ .../DOMCDATASection_construct_error_001.phpt | 21 +++++++++++++++++ .../DOMCharacterData_data_error_002.phpt | 14 +++++++++++ 5 files changed, 87 insertions(+) create mode 100644 ext/dom/tests/DOMAttr_name_basic_001.phpt create mode 100755 ext/dom/tests/DOMAttr_ownerElement_error_001.phpt create mode 100644 ext/dom/tests/DOMAttr_value_basic_002.phpt create mode 100644 ext/dom/tests/DOMCDATASection_construct_error_001.phpt create mode 100755 ext/dom/tests/DOMCharacterData_data_error_002.phpt diff --git a/ext/dom/tests/DOMAttr_name_basic_001.phpt b/ext/dom/tests/DOMAttr_name_basic_001.phpt new file mode 100644 index 0000000000..29ca8c585e --- /dev/null +++ b/ext/dom/tests/DOMAttr_name_basic_001.phpt @@ -0,0 +1,14 @@ +--TEST-- +DOMAttr read $name property. +--CREDITS-- +Nic Rosental +# TestFest Atlanta 2009-05-14 +--SKIPIF-- + +--FILE-- +name; +?> +--EXPECT-- +category \ No newline at end of file diff --git a/ext/dom/tests/DOMAttr_ownerElement_error_001.phpt b/ext/dom/tests/DOMAttr_ownerElement_error_001.phpt new file mode 100755 index 0000000000..a7766541d5 --- /dev/null +++ b/ext/dom/tests/DOMAttr_ownerElement_error_001.phpt @@ -0,0 +1,23 @@ +--TEST-- +Read $ownerElement with null parent. +--CREDITS-- +Travis Pew +# TestFest Atlanta 2009-05-14 +--SKIPIF-- + +--FILE-- +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 diff --git a/ext/dom/tests/DOMAttr_value_basic_002.phpt b/ext/dom/tests/DOMAttr_value_basic_002.phpt new file mode 100644 index 0000000000..cf71eebf39 --- /dev/null +++ b/ext/dom/tests/DOMAttr_value_basic_002.phpt @@ -0,0 +1,15 @@ +--TEST-- +Write non-string $value property +--CREDIT-- +Eric Berg +# TestFest Atlanta 2009-05-14 +--SKIPIF-- + +--FILE-- +value = 1; +print $attr->value; +?> +--EXPECTF-- +1 \ No newline at end of file diff --git a/ext/dom/tests/DOMCDATASection_construct_error_001.phpt b/ext/dom/tests/DOMCDATASection_construct_error_001.phpt new file mode 100644 index 0000000000..4db2130ba8 --- /dev/null +++ b/ext/dom/tests/DOMCDATASection_construct_error_001.phpt @@ -0,0 +1,21 @@ +--TEST-- +__construct() with no arguments. +--CREDITS-- +Nic Rosental nicrosental@gmail.com +# TestFest Atlanta 2009-5-14 +--SKIPIF-- + +--FILE-- +getMessage(); + } +?> +--EXPECT-- +DOMCdataSection::__construct() expects exactly 1 parameter, 0 given \ No newline at end of file diff --git a/ext/dom/tests/DOMCharacterData_data_error_002.phpt b/ext/dom/tests/DOMCharacterData_data_error_002.phpt new file mode 100755 index 0000000000..9dae096e6f --- /dev/null +++ b/ext/dom/tests/DOMCharacterData_data_error_002.phpt @@ -0,0 +1,14 @@ +--TEST-- +Invalid State Error when getting data on DOMCharacterData out of content. +--CREDIT-- +Eric Berg +# TestFest Atlanta 2009-05-14 +--SKIPIF-- + +--FILE-- +data; +?> +--EXPECTF-- +Warning: main(): Invalid State Error in %s on line %d \ No newline at end of file -- 2.50.1