@@ -74,7 +74,7 @@ private function init($cfgName) {
74
74
$ this ->cfgDom = new fDOMDocument ();
75
75
$ this ->cfgDom ->load ($ this ->fileInfo ->getPathname ());
76
76
$ this ->cfgDom ->registerNamespace ('cfg ' , 'http://xml.phpdox.net/config ' );
77
- $ this ->config = new GlobalConfig ($ this ->cfgDom , $ this ->fileInfo );
77
+ $ this ->config = new GlobalConfig (new FileInfo ( ' /tmp ' ), $ this ->cfgDom , $ this ->fileInfo );
78
78
}
79
79
80
80
/**
@@ -200,26 +200,47 @@ public function testVariablesGetResolvedCorrectly($expected, $file) {
200
200
}
201
201
202
202
public function resolverProvider () {
203
-
204
203
return array (
205
204
'basedir ' => array ( $ this ->baseDir . 'resolver ' , 'basedir ' ),
206
205
207
- 'phpDox.home ' => array ( realpath ( __DIR__ . ' /../../.. ' ) , 'home ' ),
206
+ 'phpDox.home ' => array ( ' /tmp ' , 'home ' ),
208
207
'phpDox.file ' => array ( $ this ->baseDir . 'resolver/file.xml ' , 'file ' ),
209
208
'phpDox.version ' => array (Version::getVersion (), 'phpdox-version ' ),
210
209
210
+ 'multi ' => array ( '/tmp ' . Version::getVersion (), 'multi ' ),
211
+
211
212
'phpDox.project.name ' => array ('projectname ' , 'named ' ),
212
213
'phpDox.project.name[undefined] ' => array ('unnamed ' , 'named-undefined ' ),
213
214
214
- // 'phpDox.project.source' => array('source','src'),
215
- // 'phpDox.project.source[undefined]' => array('src','src-undefined'),
216
215
'phpDox.project.workdir ' => array ('output ' ,'workdir ' ),
217
216
'phpDox.project.workdir[undefined] ' => array ('xml ' ,'workdir-undefined ' ),
218
217
219
- 'phpDox.php.version ' => array (PHP_VERSION , 'php-version ' )
218
+ 'phpDox.php.version ' => array (PHP_VERSION , 'php-version ' ),
219
+
220
+ 'property-global ' => array ('propvalue ' , 'property-global ' ),
221
+ 'property-project ' => array ('propvalue ' , 'property-project ' ),
222
+
223
+ 'property-recursive ' => array (Version::getVersion (), 'property-recursive ' )
224
+ );
225
+ }
226
+
227
+ /**
228
+ * @dataProvider exceptionProvider
229
+ * @uses TheSeer\phpDox\Version
230
+ */
231
+ public function testInvalidPropertyRequestThrowsException ($ file , $ code ) {
232
+ $ this ->init ('resolver/ ' . $ file );
233
+ $ this ->setExpectedException ('TheSeer \\phpDox \\ConfigException ' , $ code );
234
+ $ this ->config ->getProjects ();
235
+ }
220
236
221
- // @todo Add properties, recursive resolving
237
+ public function exceptionProvider () {
238
+ return array (
239
+ 'property-internal ' => array ('property-internal ' , ConfigException::OverrideNotAllowed),
240
+ 'property-overwrite ' => array ('property-overwrite ' , ConfigException::OverrideNotAllowed),
241
+ 'property-undefined ' => array ('property-undefined ' , ConfigException::PropertyNotFound)
222
242
);
223
243
}
244
+
224
245
}
225
246
}
0 commit comments