root/trunk/examples/TestEmptyConstructor.php

Revision 129, 0.8 kB (checked in by mikey, 10 months ago)

renamed XJConfLoader to XJConf

Line 
1 <?php
2 require_once '../XJConf/XJConf.php';
3 use net::xjconf::DefinitionParser;
4 use net::xjconf::XmlParser;
5 error_reporting(E_ALL | E_STRICT);
6
7 require 'EmptyConstructorClass.php';
8 /**
9  * @author Stephan Schmidt <stephan.schmidt@schlund.de>
10  */
11 class TestEmptyConstructor
12 {
13
14     public static function main() {
15         $tagParser = new DefinitionParser();
16         $defs = $tagParser->parse(getcwd() . '/xml/defines-empty-constructor.xml');
17
18         $conf = new XmlParser();
19         $conf->setTagDefinitions($defs);
20
21         try {
22             $conf->parse(getcwd() . '/xml/test-empty-constructor.xml');
23         } catch (Exception $e) {
24             throw $e;
25             exit();
26         }
27
28         $foo = $conf->getConfigValue('foo');
29         echo 'This should be null: ';
30         var_dump($foo->getDataFromConstructor());
31     }
32 }
33 TestEmptyConstructor::main();
34 ?>
Note: See TracBrowser for help on using the browser.