Changeset 1750
- Timestamp:
- 07/30/08 00:56:06 (4 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
framework/trunk/src/main/php/net/stubbles/xml/unserializer/stubXMLUnserializer.php
- Property svn:keywords set to Id
r1311 r1750 6 6 * @package stubbles 7 7 * @subpackage xml_unserializer 8 * @version $Id$ 8 9 */ 9 stubClassLoader::load('net::stubbles::xml::unserializer::stubXMLUnserializerOption'); 10 stubClassLoader::load('net::stubbles::lang::exceptions::stubFileNotFoundException', 11 'net::stubbles::xml::stubXMLException', 12 'net::stubbles::xml::unserializer::stubXMLUnserializerOption' 13 ); 10 14 /** 11 15 * Class to read XML files and turn them into simple PHP types. … … 60 64 * @param string $fileName 61 65 * @return mixed 66 * @throws stubFileNotFoundException 62 67 * @throws stubXMLException 63 68 */ 64 69 public function unserializeFile($fileName) 65 70 { 71 if (file_exists($fileName) === false) { 72 throw new stubFileNotFoundException($fileName); 73 } 74 66 75 $reader = $this->initParser(); 67 76 if ($reader->open($fileName, $this->options[stubXMLUnserializerOption::ENCODING_SOURCE]) === false) { framework/trunk/src/test/php/net/stubbles/xml/unserializer/stubXMLUnserializerTestCase.php
- Property svn:keywords set to Id
r1703 r1750 6 6 * @package stubbles 7 7 * @subpackage xml_unserializer_test 8 * @version $Id$ 8 9 */ 9 10 stubClassLoader::load('net::stubbles::xml::unserializer::stubXMLUnserializer'); … … 287 288 $this->assertEquals(array('string' => utf8_encode('A string containing german umlauts: &ᅵᅵᅵ')), $unserializer->unserialize($xml)); 288 289 } 290 291 /** 292 * test unserializing a non-existing file 293 * 294 * @test 295 * @expectedException stubFileNotFoundException 296 */ 297 public function unserializeNonExistingFile() 298 { 299 $unserializer = new stubXMLUnserializer(); 300 $unserializer->unserializeFile(TEST_SRC_PATH . '/resources/doesNotExist.xml'); 301 } 289 302 } 290 303 ?>
