summaryrefslogtreecommitdiff
path: root/tests/UnitTests/framework/Data
diff options
context:
space:
mode:
authorxue <>2005-11-11 20:47:02 +0000
committerxue <>2005-11-11 20:47:02 +0000
commit26ede97cc6771418af76a999931ccf5f4a8705a4 (patch)
tree95b3fa2e9834bfe0030cfd1eb29ddac985548070 /tests/UnitTests/framework/Data
parent5147906809d0fb77b75080da7fd0112a6f6f51f7 (diff)
Modified TXmlDocument::loadFromFile and loadFromString so that they return parsing status.
Diffstat (limited to 'tests/UnitTests/framework/Data')
-rw-r--r--tests/UnitTests/framework/Data/utXmlDocument.php14
1 files changed, 14 insertions, 0 deletions
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');