From 26ede97cc6771418af76a999931ccf5f4a8705a4 Mon Sep 17 00:00:00 2001 From: xue <> Date: Fri, 11 Nov 2005 20:47:02 +0000 Subject: Modified TXmlDocument::loadFromFile and loadFromString so that they return parsing status. --- tests/UnitTests/framework/Data/utXmlDocument.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'tests/UnitTests/framework/Data') diff --git a/tests/UnitTests/framework/Data/utXmlDocument.php b/tests/UnitTests/framework/Data/utXmlDocument.php index f66a4f2d..ec0e43c7 100644 --- a/tests/UnitTests/framework/Data/utXmlDocument.php +++ b/tests/UnitTests/framework/Data/utXmlDocument.php @@ -16,6 +16,20 @@ class utXmlDocument extends UnitTestCase { $dir=dirname(__FILE__).'/xml'; + $doc=new TXmlDocument; + try + { + $doc->loadFromFile('nonexisting.xml'); + $this->fail('exception not raised when openning a nonexistent file.'); + } + catch(TIOException $e) + { + $this->pass(); + } + + $doc=new TXmlDocument; + $this->assertFalse(@$doc->loadFromString('$12341')); + // a regular XML file $doc=new TXmlDocument; $doc->loadFromFile($dir.'/data1.xml'); -- cgit v1.2.3