root/branches/PRE_NAMESPACES/examples/TestEmptyConstructor.php

Revision 89, 0.9 kB (checked in by mikey, 2 years ago)

added integration tests using the existing examples

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