Example #1
0
 public function testNonEmpty()
 {
     $workingdir = getcwd();
     $configFile = Xinc_Project_Config_File::load($workingdir . '/test/resources/testNonEmptyProjects.xml');
     $parser = new Xinc_Project_Config_Parser($configFile);
     $projects = $parser->getProjects();
     $this->assertTrue($projects->count() == 1, 'One project should be detected');
     $engineName = $parser->getEngineName();
     $this->assertTrue($engineName != null, 'Should return an engine name');
 }
Example #2
0
 public function testConstructException()
 {
     $workingdir = getcwd();
     try {
         $configFile = Xinc_Project_Config_File::load($workingdir . '/test/resources/testProjectsInvalid.xml');
         $this->assertTrue(false, 'It is invalid, should throw an exception');
     } catch (Xinc_Project_Config_Exception_InvalidEntry $invalidEntry) {
         $this->assertTrue(true, 'Correct exception thrown');
     } catch (Exception $e) {
         $this->assertTrue(false, 'Should have caught ' . 'Xinc_Project_Config_Exception_InvalidEntry ' . 'but caught: ' . get_class($e));
     }
 }