public function testValidConfig() { $workingdir = getcwd(); try { $config = new Xinc_Project_Config($workingdir . '/test/resources/testNonEmptyProjects.xml'); $projects = $config->getProjects(); $this->assertTrue($projects instanceof Xinc_Project_Iterator, 'Should be of instance project iterator ' . ' but is:' . get_class($projects)); $engineName = $config->getEngineName(); $this->assertTrue($engineName != null, 'Should have an engine name'); } catch (Exception $e) { $this->assertTrue(false, 'Should not throw an exception but did: ' . get_class($e)); } }
/** * Add a projectfile to the xinc processing. * * @param string $fileName */ private function addProjectFile($fileName) { try { $config = new Xinc_Project_Config($fileName); $engineName = $config->getEngineName(); $engine = Xinc_Engine_Repository::getInstance()->getEngine($engineName); $builds = $engine->parseProjects($config->getProjects()); self::$_buildQueue->addBuilds($builds); } catch (Xinc_Project_Config_Exception_FileNotFound $notFound) { Xinc_Logger::getInstance()->error('Project Config File ' . $fileName . ' cannot be found'); } catch (Xinc_Project_Config_Exception_InvalidEntry $invalid) { Xinc_Logger::getInstance()->error('Project Config File has an invalid entry: ' . $invalid->getMessage()); } catch (Xinc_Engine_Exception_NotFound $engineNotFound) { Xinc_Logger::getInstance()->error('Project Config File references an unknown Engine: ' . $engineNotFound->getMessage()); } }