/** * load properties from an XML file. * * @param PhingFile $file */ protected function _loadFile(PhingFile $file) { $this->log("Loading " . $file->getAbsolutePath(), Project::MSG_INFO); if ($file->exists()) { $data = $this->_getData($file); $obj = new PropertyResolve($data); $properties = $obj->process(); if (isset($properties['config']['phing'])) { unset($properties['config']['phing']); if (empty($properties['config'])) { unset($properties['config']); } } $this->_save($properties); } else { $this->log("Unable to find property file: " . $file->getAbsolutePath() . "... skipped", Project::MSG_WARN); } }
public function testFactory() { $num = 5; $configFilename = $this->_testDir . '/fixture_' . $num . '.xml'; $actualFilename = $this->_testDir . '/actual_' . $num . '.php'; $obj = PropertyResolve::factory($configFilename, 'xml'); $expected = $obj->process(); $actual = (include $actualFilename); $this->assertEquals($expected, $actual); }