diff options
Diffstat (limited to 'tests/unit/Xml/TXmlElementListTest.php')
-rw-r--r-- | tests/unit/Xml/TXmlElementListTest.php | 21 |
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)); } } ?> |