summaryrefslogtreecommitdiff
path: root/tests/unit/Xml/TXmlElementListTest.php
diff options
context:
space:
mode:
authortof <>2007-06-27 11:51:32 +0000
committertof <>2007-06-27 11:51:32 +0000
commitfdb122f2da9e36dd41243a69e8ea9eec20ad3a1d (patch)
treeffe0f3ca249df9a97b80240c04cf9e5e4b827bed /tests/unit/Xml/TXmlElementListTest.php
parent0621133cf16ece2cbf4be49438ab0eacaada5630 (diff)
Add unit test for TXmlDocument and TXmlElementList
Diffstat (limited to 'tests/unit/Xml/TXmlElementListTest.php')
-rw-r--r--tests/unit/Xml/TXmlElementListTest.php21
1 files changed, 18 insertions, 3 deletions
diff --git a/tests/unit/Xml/TXmlElementListTest.php b/tests/unit/Xml/TXmlElementListTest.php
index 95906c1f..91e09267 100644
--- a/tests/unit/Xml/TXmlElementListTest.php
+++ b/tests/unit/Xml/TXmlElementListTest.php
@@ -9,15 +9,30 @@ Prado::using('System.Xml.TXmlDocument');
class TXmlElementListTest extends PHPUnit_Framework_TestCase {
public function testConstruct() {
- throw new PHPUnit_Framework_IncompleteTestError();
+ $element=new TXmlElement('tag');
+ $list=new TXmlElementList($element);
+ self::assertEquals($element,self::getAttribute($list, '_o'));
}
public function testInsertAt() {
- throw new PHPUnit_Framework_IncompleteTestError();
+ $element=new TXmlElement('tag');
+ $list=new TXmlElementList($element);
+ try {
+ $list->insertAt(0,'ABadElement');
+ self::fail('Expected TInvalidDataTypeException not thrown');
+ } catch (TInvalidDataTypeException $e) {}
+ $newElement=new TXmlElement('newTag');
+ $list->insertAt(0,$newElement);
+ self::assertEquals($newElement,$list->itemAt(0));
+
}
public function testRemoveAt() {
- throw new PHPUnit_Framework_IncompleteTestError();
+ $element=new TXmlElement('tag');
+ $list=new TXmlElementList($element);
+ $newElement=new TXmlElement('newTag');
+ $list->insertAt(0,$newElement);
+ self::assertEquals($newElement,$list->removeAt(0));
}
}
?>