svn: /pear2/Pyrus/trunk/tests/XMLParser/ parse_open_fail.phpt

From: Date: Wed, 10 Mar 2010 22:46:39 +0000
Subject: svn: /pear2/Pyrus/trunk/tests/XMLParser/ parse_open_fail.phpt
Groups: php.pear.cvs php.pear.core 
Request: Send a blank email to pear-core+get-9290@lists.php.net to get a copy of this message
dufuz Wed, 10 Mar 2010 22:46:39 +0000 Revision: http://svn.php.net/viewvc?view=revision&revision=296047 Log: Test the exception handling in parse() Changed paths: A pear2/Pyrus/trunk/tests/XMLParser/parse_open_fail.phpt Added: pear2/Pyrus/trunk/tests/XMLParser/parse_open_fail.phpt =================================================================== --- pear2/Pyrus/trunk/tests/XMLParser/parse_open_fail.phpt (rev 0) +++ pear2/Pyrus/trunk/tests/XMLParser/parse_open_fail.phpt 2010-03-10 22:46:39 UTC (rev 296047) @@ -0,0 +1,16 @@ +--TEST-- +Pyrus XMLParser: parse() opening file fails +--FILE-- +<?php +require dirname(__FILE__) . '/setup.php.inc'; + +$e = new stdClass; +try { + $res = $parser->parse('/path/to/random/file.xml'); +} catch (pear2\Pyrus\XMLParser\Exception $e) {} + +$test->assertEquals('Cannot open /path/to/random/file.xml for parsing', $e->getMessage(), 'error'); +?> +===DONE=== +--EXPECT-- +===DONE=== \ No newline at end of file

« previous php.pear.core (#9290) next »